I have a file which contains lots of records in following manner.NameAddressPhoneThis is the sequence for each record in that file. Now, I want to copy this file to other file with changed order as below.AddressPhoneNameHow to write shell script to do this?
Reorder lines in each 3-line record
shell script;text processing
Try:sed -n 'h;n;p;n;G;p' < file.in > file.outFor example:$ seq 9 | sed -n 'h;n;p;n;G;p'231564897