05-16-2012
The code from Balasejuri mostly worked, but omitted the very last "processing data" line.
Scrutinzer's code worked perfectly.
Thanks to both for your quick replies. I can stop tearing my hair out now!
---------- Post updated 16-05-12 at 10:45 AM ---------- Previous update was 15-05-12 at 01:57 PM ----------
Hi Scrutinizer - I've been trying to work out how your awk one-liner works, without success. Could you decode it for me.
Thanks
---------- Post updated at 11:46 AM ---------- Previous update was at 10:45 AM ----------
I didn't say, but sometimes the second pattern - 'processing data' - doesn't appear and there are two Header lines in a row. Scrutinizer's awk prints the last occurrence of the processing data line - can it just print the Header and move onto the next record?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All
I have a file like this
<LText>gvsvdkag<LREC>bdjvdj</LREC>nididyvv</LText>
<LText>gvsvdkag<LREC>bdj
vdj</LREC>nididyvv</LText>
<LText>gvsvdkag<LREC>b
djvdj</LREC>nididyvv</LText>
<LText>gvsvdkag<LREC>bdjvdj</LREC>nididyvv</LText>
How will i change the file to ... (9 Replies)
Discussion started by: anju
9 Replies
2. UNIX for Advanced & Expert Users
I have i got a requirement like below.
I have input file which contains following fixed width records.
00000000000088500232007112007111
I need the full record and concatenated with ~ and characters from 1to 5 and concatenated with ~ and charactes from 10 to 15
The out put will be like... (1 Reply)
Discussion started by: ukatru
1 Replies
3. Shell Programming and Scripting
I'm trying to use Awk to get the id and name fields ($1 and $2) of file1 combined with their corresponding multiline records in file2 that are separated by blank line. Both files are ordered so that the first line of file1 corresponds to the first set of multiline records in file2 and so on.
... (4 Replies)
Discussion started by: RacerX
4 Replies
4. Shell Programming and Scripting
I have a file like the below:
Start
<</NumCopies 0001>>
0223 098 et(5926)sh
0223 098 mt(5926)sh
End
Start
<</NumCopies 0001>>
0224 098 et(5926)sh
0224 098 mt(5926)sh
End
This file needs to be split to seperate files. Each of the seperate file will need to... (3 Replies)
Discussion started by: pt14
3 Replies
5. Shell Programming and Scripting
Dear Experts,
I need to extract specific records from one file which has multiline records.
Input file pattern is:
============
aaaaaaaa
bbbbbbbb
asdf 1234
cccccccc
dddddddd
============
aaaaaaaa
bbbbbbbb
qwer 2345
cccccccc
dddddddd (7 Replies)
Discussion started by: dhiraj4mann
7 Replies
6. Shell Programming and Scripting
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
The output should be
1one
2two
3three
1four
2five
3six (2 Replies)
Discussion started by: supchand
2 Replies
7. Shell Programming and Scripting
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
2eleven
2twelve
1thirteen
2fourteen
The output should be: (5 Replies)
Discussion started by: supchand
5 Replies
8. Shell Programming and Scripting
Input file 1:
- 7367 8198
- 8225 9383
+ 9570 10353
Input file 2:
- 2917 3667
- 3851 4250
+ 4517 6302
+ 6302 6740
+ 6768 7524
+ 7648 8170
+ 8272 8896
+ 8908 9915
- 10010 ... (18 Replies)
Discussion started by: perl_beginner
18 Replies
9. Shell Programming and Scripting
Input file:
pattern1 100 250 US
pattern2 50 3050 UK
pattern3 100 250 US
pattern1 70 1050 UK
pattern1 170 450 Mal
pattern2 40 750 UK
.
.
Desired Output file:
pattern1 100 250 US
pattern2 50 3050 UK
pattern1 170 450 Mal
pattern2... (3 Replies)
Discussion started by: cpp_beginner
3 Replies
10. Shell Programming and Scripting
Hello,
I have a file as :-
ABC
DEF
GHI
JKL
<BlankLine>
MNO
PQR
STU
VWX
<BlankLine>
YZA
I need it as below:-
ABCDEFGHIJKL;
MNOPQRSTUVWX; (3 Replies)
Discussion started by: jassi10781
3 Replies