Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Merging of arrays with space

by jnyman (Acolyte)
on Jun 05, 2013 at 07:31 UTC ( #1037152=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Merging of arrays with space
in thread Merging of arrays with space

I don't understand why you are doing split twice (first for the row and then for the column). If you just want to return a given column from a CSV you could do it simply with:

my @result = map { my @row = split /,/ => $_; $row[$column_number] } @lines;
assuming there isn't any escaped csv-values such as
a,b,"hello, world",c,d


Comment on Re^3: Merging of arrays with space
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037152]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2015-07-04 16:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls