Hi,
I have many unblock files in ascii format. I want to remove some strings.
Between these strings there are registers with a 203 bytes of length.
I´m using sub funtion. This funtion replaced them, but this funtion added some characters.
This strings could be in everywhere.
String number one (Length of string 240 bytes.)
dot (.) means any character
VOL1TTVOL................................NORTE..................................HDR1TTFILE01.........TTVOL.......
...............................................HDR2F020300203030AXE...../....................................................
..
registers
1104 186794
77 03300564411801000050614073550000024000020000005 0BOGONORCO24/1/201ETB1F7OFUS1PBI00700 0 0102002
0 06395460203
.
.
.
1104 186794
77 03300564411801000050614073550000024000020000005 0BOGONORCO24/1/201ETB1F7OFUS1PBI00700 0 0102002
0 06395460203
String number two (Length of string 160 bytes.)
EOF1TTFILE01.........TTVOL......................................................EOF2F020300203030AXE...../......
................................................
This is the programm
removing the firts string
awk ' { gsub(/VOL1TTVOL................................NORTE..................................HDR1TTFILE01.........TTVOL.......
...............................................HDR2F020300203030AXE.....\/....................................................
../,"",$0);print} ' $file > file_one
removiong the second string
awk ' { gsub(/EOF1TTFILE01.........TTVOL......................................................EOF2F020300203030AXE.....\/......
................................................/,"",$0);print} ' file_one > file_two
After that, those strings don´t appear but the size of the file is increased.
After, I use fold command.
fold -w 203 file > file
Thanks for your valuable input
malpa
I have many unblock files in ascii format. I want to remove some strings.
Between these strings there are registers with a 203 bytes of length.
I´m using sub funtion. This funtion replaced them, but this funtion added some characters.
This strings could be in everywhere.
String number one (Length of string 240 bytes.)
dot (.) means any character
VOL1TTVOL................................NORTE..................................HDR1TTFILE01.........TTVOL.......
...............................................HDR2F020300203030AXE...../....................................................
..
registers
1104 186794
77 03300564411801000050614073550000024000020000005 0BOGONORCO24/1/201ETB1F7OFUS1PBI00700 0 0102002
0 06395460203
.
.
.
1104 186794
77 03300564411801000050614073550000024000020000005 0BOGONORCO24/1/201ETB1F7OFUS1PBI00700 0 0102002
0 06395460203
String number two (Length of string 160 bytes.)
EOF1TTFILE01.........TTVOL......................................................EOF2F020300203030AXE...../......
................................................
This is the programm
removing the firts string
awk ' { gsub(/VOL1TTVOL................................NORTE..................................HDR1TTFILE01.........TTVOL.......
...............................................HDR2F020300203030AXE.....\/....................................................
../,"",$0);print} ' $file > file_one
removiong the second string
awk ' { gsub(/EOF1TTFILE01.........TTVOL......................................................EOF2F020300203030AXE.....\/......
................................................/,"",$0);print} ' file_one > file_two
After that, those strings don´t appear but the size of the file is increased.
After, I use fold command.
fold -w 203 file > file
Thanks for your valuable input
malpa