P is for Practical | |
PerlMonks |
Re: Extracting multiple column from csv file and adding/appending onto new csv file with first columns already existingby kcott (Archbishop) |
on Apr 18, 2014 at 01:06 UTC ( [id://1082694]=note: print w/replies, xml ) | Need Help?? |
G'day bks, Welcome to the monastery. "I would be getting similar output from different devices and i would like append the output to same csv file" I don't know which of the two CSV files this refers to. Use a mode of '>' to write to a new file; and a mode of '>>' to append to an existing file. See open for details. I've used append mode for both files in the code below. "I tried installing text::csv_xs, but unfortunately i wasnt able extract *.tgz as it gave some checksum error. Please guide me or point me in right direction about how to install modules that are in *.tgz format" You'll need to show us what you did and what output you got. The guidelines in "How do I post a question effectively?" explain the sort of information we need and how to present it. "Please post some sample code to achieve my requirement that would really be of great help" The code below shows how to use Text::CSV for all your I/O.
Here's the file contents after running that script.
-- Ken
In Section
Seekers of Perl Wisdom
|
|