Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tabl-delimited to comma-delimited

Status
Not open for further replies.

jggrossm

IS-IT--Management
Joined
Feb 8, 2007
Messages
5
Location
US
I only use perl now and then, so I'm not a whiz at it. This might seem wicked obvious to you all, but I'm trying to use this:

perl -pi.bak -e 's/\t/,/g' myfile.txt
which I found here:

to convert some tab-delimited files into comma-delimited. But I'm getting:
Execution of -e aborted due to compilation errors. I tried w/o the -e, but got:
Use -S to search $PATH for it.

I'm confused. This seems like it should be really simple. Thanks in advance!
 
Just so you know, that assumes a simple tab-delimited file where none of your fields will themselves contain a tab. If that isn't the case, you need something more powerful such as the Text::CSV or Text::CSV_XS modules.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top