Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Parsing a comma delimited file

by broquaint (Abbot)
on Feb 13, 2003 at 14:07 UTC ( [id://234973]=note: print w/replies, xml ) Need Help??


in reply to Parsing a comma delimited file

However it gives me a warning message at the begining
That would be the filenames in you open calls. You need to use single quotes instead as the backslash is trying to escape the 'd' following it which is not what you want e.g
open(IN, '<c:\doclist.chr') or die "Couldn't open file, $!"; open(OUT, '>c:\doclist.txt') or die "Couldn't open file, $!";
Also can I suggest a simplification to your while loop
print OUT join '|', split /,/ while <IN>;
Now you're not limited to seven fields (although you can enforce this using the 3rd argument of split) and you've done it all on a single line, hurrah!
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Parsing a comma delimited file
by Skyler99 (Novice) on Feb 13, 2003 at 15:15 UTC
    Thanks for the info ... the program works like a charm!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-16 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found