Tag Info

New answers tagged


The better way to change the column separator and use columncommand: sed 's/ */;/g' file | column -ts';' which produce: Item Code Active Description Store Room Row Shelf Bin On Hand 38NUTZSL Y 3/8"-16 HEX ZINC NUT B 03 C 2 0 WELD-AL Y WELD, ALUM. ROD, ...


You need to set Output Field Separator to tab \t: One way to do it is with -v option: awk -vOFS='\t' '{$3 = "AD"; print}' file another possibility inside awk, say in the BEGIN block: awk 'BEGIN{OFS="\t"}{$3 = "AD"; print}' file


Try this, sed -ri 's/([0-9]+)/<a href=\"&.html\">link<\/a>/g' index.html


How about : sed 's_^\([^>]\+>\)\([[:digit:]]\+\)_\1<a href="\2.html">link</a>_' file.txt We are using _ in the sed substitution pattern format instead / as / is present in the input ^\([^>]\+>\) finds the characters upto > (including) and put them in a group \([[:digit:]]\+\) finds the mentioned digits and put them in a group ...


sed -e 's/ test3 / /g' -e 's/ test3//g' -e 's/test3 //g' myfile.txt Please try above

Top 50 recent answers are included