Re: A little bash/perl programming help?
- From: Ivan Marsh <annoyed@xxxxxxx>
- Date: Thu, 27 Sep 2007 15:59:11 -0500
On Thu, 27 Sep 2007 20:26:51 +0000, Stuart Miller wrote:
"Ivan Marsh" <annoyed@xxxxxxx> wrote in message
news:pan.2007.09.27.16.30.11.967926@xxxxxxxxxx
Okay, I admit it, I'm stumped.It looks to me like a perl script for this would be very easy to write.
I'm trying to write a script to parse out text files into 80 charter
line lengths with column numbering over each line and I just can't seem
to get the logic straight in my head. The desired output would look
(something) like:
123456789012345678901234567890123456789012345678901234567890 All work
and no play makes jack a dull boy. All work and no
123456789012345678901234567
play makes jack a dull boy.
Putting each 80 character section on a separate line with the column
numbers over it.
Anyone have anything that does something like this? I was trying to
write it in bash but got more confused the more I worked on it. A perl
example would work too.
(For the record: No, it's not homework. I'm trying to write a script I
just lost when a very old server died.)
I would need to know the format of the input text file, delimiters,
etc.and what form the output would take - console, text file, report
type file. Logic would need to check line length, if > 80 take left 80
characters, process & print; if < 80 and not end of file read &
concatenate next line, and loop.
Depending on the complexity of the input and output section, I see it
taking 2-3 hours to write.
That means that a professional programmer can do in in 20 minutes....
The input files are all fixed length records with the fields falling in
the same place in every record (but not the same in every file):
Last_Name First_Name Address
Smith John 123
Sasafrace Mcgillicutty 7643
Satyanarayan Fred 734673
Etc...
--
I told you this was going to happen.
.
- References:
- Re: A little bash/perl programming help?
- From: Stuart Miller
- Re: A little bash/perl programming help?
- Prev by Date: Re: A little bash/perl programming help?
- Next by Date: Re: A little bash/perl programming help?
- Previous by thread: Re: A little bash/perl programming help?
- Next by thread: Re: A little bash/perl programming help?
- Index(es):
Relevant Pages
|