Re: How to remove trailing commas and points from a CSV file ?
- From: yitzle@xxxxxxxxxxxxxxxxxxxxx (Yitzle)
- Date: Thu, 26 Jun 2008 13:36:27 -0400
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> ) {
.
- Follow-Ups:
- Re: How to remove trailing commas and points from a CSV file ?
- From: Perez Erasmo
- Re: How to remove trailing commas and points from a CSV file ?
- References:
- How to remove trailing commas and points from a CSV file ?
- From: Erasmo Perez
- Re: How to remove trailing commas and points from a CSV file ?
- From: Jeff Peng
- Re: How to remove trailing commas and points from a CSV file ?
- From: Perez Erasmo
- How to remove trailing commas and points from a CSV file ?
- Prev by Date: Re: How to remove trailing commas and points from a CSV file ?
- Next by Date: How can I translate it back to @ sign.
- Previous by thread: Re: How to remove trailing commas and points from a CSV file ?
- Next by thread: Re: How to remove trailing commas and points from a CSV file ?
- Index(es):
Relevant Pages
|