masalachol
Technical User
Hello:
I am bringing this up again since we have gotten a little further and my previous comments and thus looking for some urgent input.
Well I have a csv file where some strings are enclosed by a quotation marks. We found that the following sed operation sed 's/\(".*\)[,]\(.*"\)/\1\2/g'
will remove the comma's within the quotation marks (if any exist)(this is what we want) only if one set of quotation marks exist within each line. When more than one set of quotation marks exists then the sed operation does not work on that particular line.
sed 's/\(".*\)[,]\(.*"\)/\1\2/g'
xxxxxxx,xxxxxxxx,"Russellville,",AR,xxxxxx,xxxxxxx,xxxxxxxx,",ARLINGTON HEIGHTS,IL,60005,US,5.96,0.98,,,,,,,,,,,,,,,,,,,,, ,,,,
Therefore, does any one know how to pass a second or third or multiple arguments within the sed operations so when it does pass through a line with multiple quotes it understands it and executes the operation of removing the comma's which is what we want to accomplish.
I am bringing this up again since we have gotten a little further and my previous comments and thus looking for some urgent input.
Well I have a csv file where some strings are enclosed by a quotation marks. We found that the following sed operation sed 's/\(".*\)[,]\(.*"\)/\1\2/g'
will remove the comma's within the quotation marks (if any exist)(this is what we want) only if one set of quotation marks exist within each line. When more than one set of quotation marks exists then the sed operation does not work on that particular line.
sed 's/\(".*\)[,]\(.*"\)/\1\2/g'
xxxxxxx,xxxxxxxx,"Russellville,",AR,xxxxxx,xxxxxxx,xxxxxxxx,",ARLINGTON HEIGHTS,IL,60005,US,5.96,0.98,,,,,,,,,,,,,,,,,,,,, ,,,,
Therefore, does any one know how to pass a second or third or multiple arguments within the sed operations so when it does pass through a line with multiple quotes it understands it and executes the operation of removing the comma's which is what we want to accomplish.