This command is not removing all spaces from file . Still i can see a single space before each semicolon.
Could you help me on this .
My file also contains some special characters specially French characters.
derni�res ann�es
When I try replacing this character using sed/awk , I am unable to replace them that is I am unable to print them on command prompt . When I copy paste these two words in my command special characters replace them with some other characters.
So until I print them in my command, I cannot replace them.
Any way to do this I need to replace that A stuff with small a and E stuff with small e .
Here gsub(/ /, x) , we are replacing all the spaces with nothing
In your code, you are resetting the field separator from multiple spaces to 1, it will supresses the continues spaces to one
$ ./s1
Environment: LC_ALL = C, LANG = C
(Versions displayed with local utility "version")
OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
Distribution : Debian 5.0.8 (lenny, workstation)
bash GNU bash 3.2.39
iconv (GNU libc) 2.7
-----
Input data file data1:
derni�res ann�es
-----
Results:
derniEres annAes
data1: UTF-8 Unicode text
data2: ASCII text
I usually use "C" for the locale, but you may need to set it to something different as noted on the line executing the iconv command. See man pages for details.