![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Search and replace particular characters in fixed length-file
Masters, I have fixed length input file like Code:
FHEAD0000000001XXXX20090901 0000009000Y1000XXX2 THEAD000000000220090901 ITM0000109393813 430143504352N22SP 000000000000RN000000010000EA P0000000000000014390020090901 TTAIL0000000003000000 FTAIL00000000040000000002 Note the fields in Bold Italicized.. These fields need to be replaced with variable in shell script( of same format YYYYMMDD ). I used cut command, but it is trimming the spaces between the fields. How to I achieve this field replacement, without changing the length/ format of the file ---------- Post updated at 03:08 PM ---------- Previous update was at 03:07 PM ---------- Forogt to mention that I have to change only in FHEAD and THEAD records only in those positions. |
|
|||
|
thanx guys..tried awk command and working the way i want....will try other commands too...
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| cut, fixed length files, replace characters |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| search and replace fixed length record file | nedkelly007 | Shell Programming and Scripting | 0 | 08-06-2009 03:26 PM |
| awk - replace number of string length from search and replace for a serialized array | otrotipo | Shell Programming and Scripting | 1 | 07-10-2009 01:04 PM |
| Convert a tab delimited/variable length file to fixed length file | Everton_Silveir | UNIX for Dummies Questions & Answers | 2 | 12-19-2008 06:21 PM |
| What the command to find out the record length of a fixed length file? | tranq01 | UNIX for Dummies Questions & Answers | 9 | 12-04-2008 04:04 PM |
| sed replace with fixed length | McLan | Shell Programming and Scripting | 7 | 05-15-2008 03:57 AM |