Guys, I need help with this.
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:
asset_id~asset_tag~asset_cl~col1|col2|col3|....
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:
col8~col5~col10~col1|col2|col3|col4|col5|col6|col7|col8|col9|col10
I am new to perl and how would I achieve this?
Appreciate your help.
Thanks.