Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Fixed with file- removing leading zeros and adding the space

$
0
0
Hi All,

i have a fixed width file , where each line is 3200 length.

File:

Code:

1ABC 1111 2222 3333 000012341 1001
2ABC 1111 2222 3333 000012342 1002
3ABC 1111 2222 3333 000112343 1003
1DEF 5555 4444 9696 000012344 1004
2DEF 5555 2323 8686 000012345 1005
3DEF 5555 1212 7676 000012346 1006

note: above is the sample the original file line length is 3200

requirement:

output needed:

Code:

1ABC 1111 2222 3333 12341    1001
2ABC 1111 2222 3333 12342    1002
3ABC 1111 2222 3333 112343  1003
1DEF 5555 4444 9696 12344    1004
2DEF 5555 2323 8686 12345    1005
3DEF 5555 1212 7676 12346    1006


requirement:

from the position 21 - 29 ,we need to remove the leading zeros and rpad for 9 characters with space.

The file which we are using is very huge file. so please give command which will run faster.

version used:
SunOS sasbsd27c1 5.10 Generic_150400-10 sun4u sparc SUNW,SPARC-Enterprise

Viewing all articles
Browse latest Browse all 16232

Latest Images

Trending Articles



Latest Images