find and replace (probably with sed) or some other linux commands
The file I would like to to replace is almost 1GB.
Here is an example. ,A,B,,,,,C,c,,,"Test, This",, replace to "",A,B,"","","","",C,c,"","","Test, This","","" Thanks in advance. Joe |
use gawk for big files
Code:
awk -F"," '{ |
Thank you very much ghostdog74.
It worked well except in two scenarios. One is very rare 1. when there are more than one , in double quotes eg. "Test,, This" 2. It didn't replace comma at the end. eg. a,b,, should be a,b,"","". Both are minor and I think I should be able to tweak the code. I appreciate your help. Joe |
All times are GMT -5. The time now is 04:03 PM. |