I have two columns (fields) in my text file. I am trying to insert ‘| FOO This is a description
BAR Another description for bar
TEXT Another description for TEXT

So I ran awk '{ print $1 "|"; $1=""; print}' input > output but print command is adding a new line:
This is a description
Another description for bar
Another description for TEXT

Is there any way to tell awk not to print a newline and create the file? Here is what I want so that I can create final HTML table based upon ‘|‘:
FOO|This is a description
BAR|Another description for bar
TEXT|Another description for TEXT

[continue reading…]

How do I a print line after matching /regex/ using awk under Linux / UNIX operating systems? I’d like print the line immediately after a line that matches /regex/ but not the line that matches itself.
[continue reading…]

I am a new Unix system user with a bash as a default shell. I can append text to a file using >> operator but how do I prepend a text to a file? I want the opposite operation of >>. How can I prepend some data to a text file? How do we add text to the beginning of a file in Bash under Linux?
[continue reading…]