![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| append each line on fixed position 31 to 33 | kshuser | Shell Programming and Scripting | 5 | 3 Weeks Ago 06:11 PM |
| append existing file with zeroes bsed on position | kshuser | Shell Programming and Scripting | 3 | 3 Weeks Ago 04:39 PM |
| find if a position is between a given start and end position | fadista | UNIX for Dummies Questions & Answers | 9 | 12-04-2008 12:17 PM |
| how to find a position and print some string in the next and same position | naveenkcl | Shell Programming and Scripting | 1 | 08-21-2008 01:18 PM |
| Append line based on fixed position | ashikin_8119 | Shell Programming and Scripting | 2 | 03-19-2008 04:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I have a file FILE1.DAT like below
21111111110001343 000001004OLF-AA029100020091112 21111111110000060 000001004ODL-CH001000020091112 24444444440001416 000001045OLF-AA011800020091112 23333333330001695 000001039OLF-AA030600020091112 23333333330000111 000001039ODL-SP002000020091112 23333333330000060 000001039ODL-CH001000020091112 22222222220000780 000001013OLF-AA006500020091112 i like to append the values only for the position 28:33 OLF-AA to OLF-1E ODL-SP to ODL-2S ODL-CH to ODL-3C 21111111110001343 000001004OLF-1E029100020091112 21111111110000060 000001004ODL-3C001000020091112 24444444440001416 000001045OLF-1E011800020091112 23333333330001695 000001039OLF-1E030600020091112 23333333330000111 000001039ODL-2S002000020091112 23333333330000060 000001039ODL-3C001000020091112 22222222220000780 000001013OLF-1E006500020091112 This i want in .KSH script, thanks in advance. i have the following data in the FILE1 21111111110000204 000029148OLF-AA006300020091112 22222222220004038 000002304OLF-AA012500020091112 0003231 0000060 23333333330003265 000002315OLF-AA039300020091112 0000415 24444444440001344 000009896OLF-AA011200020091112 0000120 25555555550001778 000002331OLF-AA021400020091112 26666666660001098 000002336OLF-AA003400020091112 0000969 27777777770002653 000002349OLF-AA047900020091112 28888888880000636 000026198OLF-AA005300020091112 29999999990000244 000029309OLF-AA004800020091112 21231231230001440 000010268OLF-AA012000020091112 0001200 24564564560004404 000002368OLF-AA020300020091112 i like to append only those line having empty space for the position 50-56 & 58-64 with 7 zeros 0000000 (eg: record line 7, 8 & 9) the outfile FILE2.txt should be like this 21111111110000204 000029148OLF-AA006300020091112 0000000 0000000 22222222220004038 000002304OLF-AA012500020091112 0003231 0000060 23333333330003265 000002315OLF-AA039300020091112 0000415 0000000 24444444440001344 000009896OLF-AA011200020091112 0000120 0000000 25555555550001778 000002331OLF-AA021400020091112 0000000 0000000 26666666660001098 000002336OLF-AA003400020091112 0000969 0000000 27777777770002653 000002349OLF-AA047900020091112 0000000 0000000 28888888880000636 000026198OLF-AA005300020091112 0000000 0000000 29999999990000244 000029309OLF-AA004800020091112 0000000 0000000 21231231230001440 000010268OLF-AA012000020091112 0001200 0000000 24564564560004404 000002368OLF-AA020300020091112 0000000 0000000 this i like to have in .KSH script thxs in adv. Last edited by vbe; 2 Weeks Ago at 02:00 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|