manipulate csv module

manipulate csv module

am 22.06.2006 04:53:45 von lancerset

Hello All,

I have a .csv file which has 3 columns of data. Is there a
module that i can use that will allow me to manipulate this file.
Like remove some data from 1 column and add it to another, add
and remove columns etc...

Thanks,

Re: manipulate csv module

am 22.06.2006 13:15:31 von Bob Lanteigne

onlineviewer wrote:
> Hello All,
>
> I have a .csv file which has 3 columns of data. Is there a
> module that i can use that will allow me to manipulate this file.
> Like remove some data from 1 column and add it to another, add
> and remove columns etc...
>
> Thanks,

Googling "perl text csv" returns a link to:

Module: Text::CSV

Description:
Text::CSV provides facilities for the composition and decomposition
of
comma-separated values. An instance of the Text::CSV class can
combine
fields into a CSV string and parse a CSV string into fields.


Might be a good place to start.

Re: manipulate csv module

am 22.06.2006 17:32:41 von unknown

Bob Lanteigne wrote:
> onlineviewer wrote:
>
>>Hello All,
>>
>>I have a .csv file which has 3 columns of data. Is there a
>>module that i can use that will allow me to manipulate this file.
>>Like remove some data from 1 column and add it to another, add
>>and remove columns etc...
>>
>>Thanks,
>
>
> Googling "perl text csv" returns a link to:
>
> Module: Text::CSV
>
> Description:
> Text::CSV provides facilities for the composition and decomposition
> of
> comma-separated values. An instance of the Text::CSV class can
> combine
> fields into a CSV string and parse a CSV string into fields.
>
>
> Might be a good place to start.
>

Searching http://search.cpan.org/ for CSV also works.

Tom Wyant

Re: manipulate csv module

am 22.06.2006 18:24:15 von lancerset

Thanks for the response. I found Tie::Handle::CSV which seems to be ok.
I am trying to
iterate over the Title column so i can perform an action on each piece
of data.
I am trying a while loop but not working out too well. Any
suggestions.?
Thanks,

$csv_fh = Tie::Handle::CSV->new( 'file01.csv', openmode => '+<' );

print +( scalar <$csv_fh> )->{'Title'}, "\n";

This is not working:
while ($csv_fh->{'Title'}){
print "bla bla\n";
}




Bob Lanteigne wrote:
> onlineviewer wrote:
> > Hello All,
> >
> > I have a .csv file which has 3 columns of data. Is there a
> > module that i can use that will allow me to manipulate this file.
> > Like remove some data from 1 column and add it to another, add
> > and remove columns etc...
> >
> > Thanks,
>
> Googling "perl text csv" returns a link to:
>
> Module: Text::CSV
>
> Description:
> Text::CSV provides facilities for the composition and decomposition
> of
> comma-separated values. An instance of the Text::CSV class can
> combine
> fields into a CSV string and parse a CSV string into fields.
>
>
> Might be a good place to start.