![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk script to update header record | klut | Shell Programming and Scripting | 5 | 04-16-2008 06:04 AM |
| How to extract duplicate records with associated header record | run_eim | UNIX for Dummies Questions & Answers | 17 | 01-16-2007 08:46 PM |
| Need to Chop Header and Footer record from input file | coolbudy | Shell Programming and Scripting | 4 | 08-09-2005 09:26 AM |
| awk: record has too many fields | chaandana | Shell Programming and Scripting | 3 | 07-29-2005 10:03 AM |
| reconstructing a record in a diffrent order | r1500 | UNIX for Dummies Questions & Answers | 1 | 10-16-2003 02:24 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
change order of fields in header record
Hello,
after 9 months of archiving 1000 files, now, i need to change the order of fields in the header record. some very large, space padded files. HEADERCAS05212008D0210DOMEST01(spacepadded to record length 210) must now be 05212008HEADERCASD0210DOMEST01(spacepadded to record length 210) Does anyone know a way to manipulate the first record only and resave the file? I appreciate your time and expertise Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
An example how you can achieve that:
Code:
awk 'NR==1{print substr($0,10,8) substr($0,1,9) substr($0,18);next}1' file > file_temp
mv file_temp file
|
|||
| Google The UNIX and Linux Forums |