awk – how to delete first column with field separator

This is simple with cut:

$ cut -d'|' -f1 infile
87540221
87540258
87549647

$ cut -d'|' -f2- infile
1356438283301|1356438284971|1356438292151697
1356438283301|1356438284971|1356438292151697
1356438283301|1356438284971|1356438292151697

Just redirect into the file you want:

$ cut -d'|' -f1 infile > outfile1

$ cut -d'|' -f2- infile > outfile2 && mv outfile2 file 

Leave a Comment