Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Using Perl and WriteExcel to split data from one column to many others

by Anique (Acolyte)
on Oct 03, 2012 at 08:01 UTC ( #997001=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Using Perl and WriteExcel to split data from one column to many others
in thread Using Perl and WriteExcel to split data from one column to many others

I get the funny feeling your 'first column' is just a string like this "(a, b, c, d)" (but I might be wrong, as I am new at this) If that is the case, removing the parentheses and then splitting on the comma will fix your issue:

my $set = $res[0]; #I use a lot of 'extra' variables to tell me what everything is $set =~ s/[\(\)]//g; #remove all parentheses my @values = split(',', $set); #now every value should have its own spot in the array

I hope this solves your problem.

Please ignore me if this is a stupid answer...


Comment on Re^3: Using Perl and WriteExcel to split data from one column to many others
Download Code
Re^4: Using Perl and WriteExcel to split data from one column to many others
by squarez (Initiate) on Oct 03, 2012 at 17:58 UTC
    Thank you for the help, went with your solution as it proved very quick :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-07-05 00:00 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