Results 1 to 3 of 3
Need to remove all commas in the CSV file and save it in an array using perl...
example :
first.csv
{ 10,654,7,86,85,85,5,532,53,798,}
output.csv should look like this..
{10 644 7 ...
- 06-30-2009 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 9
perl to read csv file
Need to remove all commas in the CSV file and save it in an array using perl...
example :
first.csv
{ 10,654,7,86,85,85,5,532,53,798,}
output.csv should look like this..
{10 644 7 86 85 85 5 532 53 798}
- 07-02-2009 #2
I am not perl expert. However you can try this. I am not sure how to put it in a array.
I have tested and it successfully removes your commas.Code:perl -p -i -e "s/,/ /g " first.csv > ouput.csv
Jaysunn
- 07-04-2009 #3Linux User
- Join Date
- Aug 2006
- Posts
- 458
Code:awk -F"," '{$1=$1}1' OFS=" "


Reply With Quote