Hello All,
I've got some files on our AS/400 that I'm pulling down into Linux and
I'd like to open up this file and pull out some of the information and
display it before sending it off. I'm not sure the best way to go about
doing this, and am open to suggestions.
The file is fixed length (289 chr/line if memory serves) and I'd like to
break it up into the different fields, but I'm really unsure as to how to
go about doing this. Each field is also a fixed length, so I'm assuming
with that information it should be "fairly" simple to do. I could do this
fairly easy in perl or for that matter gawk, but I'm not trying to learn
either of them, but C. :-)
I'd welcome any comments, pointers, examples, or suggestions.
Below is one line out of the file (sorry, it wraps in here) and the file
layout from the AS/400.
Entry from file:
00000398033306008202/11/199781922F130102/13/1997000002021000002011371002I0001350001350001377731165421V270
741 6632 2002/15/1973023 V202
01-03-60 4888125230404007636W
File Layout (length of each field):
12S 0 <-=decimal point(s)
6
10
5S 0
1
1
1
2
10
9S 0
9S 0
3S 0
3S 0
1
6
6
6
5
5
5
4
4
4
2
10
3S 0
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
12
9S 0
5
5
1
Best Regards,
Tim
--
[EMAIL PROTECTED]
[EMAIL PROTECTED] (Home)
[EMAIL PROTECTED] (Work)
D I P C
The system that enables you to write distributed programs.......the
easy way!
http://wallybox.cei.net/dipc/