ZWcarp has asked for the wisdom of the Perl Monks concerning the following question:
So a coworker sent me an excel file, which I need to do some simple parsing with in order to utilize. I have run into issues before with excel files but usually gotten around them with a couple dos2unix style commands. I'm not sure what is different about this file, but my usual methods just aren't working. First I saved the excel file as a tab delimited file, and I've noticed that if I use lets say
cut -f1 Filename.txt I only get the very first row. I first tried using the command perl -i -pe 'tr/\015/\n/d' Filename.txtTo try and remove any carriage returns and replace with \n . Usually this works however, this time for what ever reason I'm still having issues. I've tried od -tc on the file to look for any weird characters that might be screwing up my line read in. Does anyone have any ideas of what might be causing the issue?
Update: Problem was due to color markup in the excel file which left hidden characters behind, I solved this by just using text edit to get rid of "rich text" . Not sure how the same thing would be done in perl . Thanks all for your responses
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Excel File Dos2Unix not working
by Tux (Canon) on Jul 12, 2011 at 10:45 UTC | |
|
Re: Excel File Dos2Unix not working
by choroba (Cardinal) on Jul 12, 2011 at 11:42 UTC |