linux - awk - how to delete first column with field separator -
i have csv file data presented follows
87540221|1356438283301|1356438284971|1356438292151697 87540258|1356438283301|1356438284971|1356438292151697 87549647|1356438283301|1356438284971|1356438292151697
i'm trying save first column new file (without field separator , , delete first column main csv file along first field separator.
any ideas?
this have tried far
awk 'begin{fs=ofs="|"}{$1="";sub("|,"")}1'
but doesn't work
this simple cut
:
$ cut -d'|' -f1 infile 87540221 87540258 87549647 $ cut -d'|' -f2- infile 1356438283301|1356438284971|1356438292151697 1356438283301|1356438284971|1356438292151697 1356438283301|1356438284971|1356438292151697
just redirect file want:
$ cut -d'|' -f1 infile > outfile1 $ cut -d'|' -f2- infile > outfile2 && mv outfile2 file
Comments
Post a Comment