I would like to remove all the newline character that occurs after a partiular string and replace it with a tab space. Say for instance my sample.txt is as follows
perl -pe 's/foo\n/foo\t/g' temp2.txt
below is the test.
243> cat temp2.txt foo bar bar bar bar some text pearl[ncm_o12.2_int_x86.@2].244> perl -pe 's/foo\n/foo\t/g' temp2.txt foo bar bar bar bar some text
In awk:
awk '/foo$/ { printf("%s\t", $0); next } 1'