zedex
1
hi all
i have input file like this abc.txt
filename.out:
<TAB>ABC<TAB>9
<TAB>AKC<TAB>1
filename1.out:
<TAB>XYZ<TAB>1
<TAB>XYN<TAB>4
and i am trying to replace \n\t with \t so that output will be like this:
filename.out:<TAB>ABC<TAB>9<TAB>AKC<TAB>1
filename1.out:<TAB>XYZ<TAB>1<TAB>AYN<TAB>4<TAB>
i am using
perl -pi -e 's/\n\t/\t' abc.txt
its not working but when i do it from vim it works is ther any other command to do the same task
tr -s '\n' '\t' < filename.out > newfile
Try this:
awk ' BEGIN { ORS="" };/^filename/{ if ( NR != 1) print "\n" };{ print }' FIlename
zedex
5
hi all
i have input file like this abc.txt
filename.out:
<TAB>ABC<TAB>9
<TAB>AKC<TAB>1
filename1.out:
<TAB>XYZ<TAB>1
<TAB>XYN<TAB>4
and i am trying to replace \n\t with \t so that output will be like this:
filename.out:<TAB>ABC<TAB>9<TAB>AKC<TAB>1
filename1.out:<TAB>XYZ<TAB>1<TAB>AYN<TAB>4<TAB>
i am using
perl -pi -e 's/\n\t/\t' abc.txt
its not working but when i do it from vim it works is ther any other command to do the same task