[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Fwd: Re: [OT] Bash Script Help]




Apologies Colin, the reply was meant to go to the list :-(

Fred L Youhanaie wrote:

Hi Colin,

Colin Ingram wrote:

Paul Smith wrote:

I was hoping to make this solution as simple as possible, so that my colleagues (most won't know perl or any other scripting language, but have experience with the shell) may use this code and be able to modify it easily to fit their needs. (They may or may not start with a file of the same format)


I have had to deal with this sort of things on quite a number of occasions, and I have my own little perl script, which is very similar to Paul's, mine came straight out of the perl cookbook ;-)

If you replace Paul's last print statement with:

    print join('|', @fields), $/;

you will end up with a filter that produces a '|'-separated file, which can then be processed with shell/awk/cut etc., or whatever your users are comfortable with.

HTH

Cheers
f.




Reply to: