perl.beginners
[Top] [All Lists]

Re: How to remove trailing commas and points from a CSV file ?

Subject: Re: How to remove trailing commas and points from a CSV file ?
From: perez.erasmo@xxxxxxxxx (Perez Erasmo)
Date: Thu, 26 Jun 2008 13:59:38 -0500
Newsgroups: perl.beginners

Hi dear Yitzle:

Thank you very much for you suggestion about the sustitution of the
code, required to treat separately the CSV file (from the perl code).

It has worked flawlessly :-)

Thank you (all) very much

Regards

On 26/06/2008, yitzle <yitzle@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Jun 26, 2008 at 1:14 PM,  <perez.erasmo@xxxxxxxxx> wrote:
>> Hi dear Jeff:
>>
>> Thank you very much for your help
>>
>> Yiur script is working flawlessly
>>
>> Just another question:
>>
>> How could I re-write your script in order to treat the __DATA__
>> portion of your code as an external file ?
>>
>> I happen to have the whole CSV file and I would not want to mix
>> directly with it, but to reference it from the perl code
>>
>> How could I accomplish that ?
>>
>> Should I substitue the <DATA> for the name of the CSV file in the perl
>> code ?
>>
>> Thank you very much for any help
>>
>> Regards
>>
>> Erasmo
>
> Replace:
>     while(<DATA>) {
> with
>     while( <> ) {
> and then call the script like:
>     script.pl datafile
> or replace it with
>     open( my $fileHandle, "< datafile" ) or die;
>     while( <$fileHandle> ) {
>

<Prev in Thread] Current Thread [Next in Thread>