SED/AWK: How to replace except between chars?

November 14, 2010 at 03:20:18
Specs: openSuSE 11.3, 4GB
Hi there,

i have a textfile like

word 0909 4345 word2 hello "this is info" 0987

Now I need to "replace every whitespace with a semicolon (;) EXCEPT in between the quotation marks.
My goal:

word;0909;4345;word2;hello;"this is info";0987

I was hoping for sed, but I cant achieve anything intelligent on that.

Anyone has a sed or awk solution for this?

Thanks in advance


See More: SED/AWK: How to replace except between chars?

Report •

#1
November 15, 2010 at 11:32:57
This sed solution is smiliar to what you are asking for:

http://main.rtfiber.com.tw/~changyj...

In fact, this entire site has my highest recommendation:

http://main.rtfiber.com.tw/~changyj...


Report •
Related Solutions


Ask Question