Re: [PBML] Parsing generic file
- Hi Rajagopal,
On Wed, 24 Jul 2013 23:33:11 -0000
"Rajagopal" <raaajah@...> wrote:
> Guys, I need help with this.I find it hard to understand exactly what you want to do, but you should look
> I need to write a perl program that should output a file. Parameters are:
> SomePerl.pl infile outfile 8 5 10.
> infile can be any standard file with a header record with a delimiter.
> Columns (numbers, names and position) can change from file to file.
> outfile is the output I want with the following:
> where asset_id, asset_tag and asset_cl is mapped to columns 8, 5 and 10.
> Column header in the file may not be exactly named as asset_id, asset_tag or
> asset_cl. Output file row should look like:
> I am new to perl and how would I achieve this?
into the following resources for insights:
1. File Input/Output in Perl -
2. Regular expressions for matching text -
3. Text::CSV and friends for robust input/output to Comma-Separated-Value (CSV)
4. Make sure you avoid using commonly-used bad elements in Perl:
*Note*: http://perl-begin.org/ is a site I originated and maintain, but I
believe the links I've given there are of relevance here.
Furthermore, in the future, you may wish to post your question to
beginners@... , where there are more people who can help you:
Shlomi Fish http://www.shlomifish.org/
What Makes Software Apps High Quality - http://shlom.in/sw-quality
He says “One and one and one is three”.
Got to be good‐looking ’cause he’s so hard to see.
— The Beatles, “Come Together”
Please reply to list if it's a mailing list post - http://shlom.in/reply .