What my puzzle file!, How to remove special characters ??
My application generate file but it have special characters in these file.
I would like to clear special characters by vi editor and not use
I try to remove characters manually, but I'm can not!
root@MyHost /tmp> ls -l puzzle.txt
-- After remove it by vi (I press x for 3 times because it have 3 char right?) --
How I remove special chars???
you can try from attachement [NO Virus]
I couldn't download puzzle.txt so cannot be 100% sure. But the other proposed solution did NOT seem to work when I tried it on a small test file I made. I think this will get rid of all special characters, and adjust to your locale:
-- After remove it by vi (I press x for 3 times because it have 3 char right?) --
How I remove special chars???
The short answer is: you can't The single char "ls" shows is the End-of-File-character (literally a "^D") and it isn't possible with "vi" to delete it. In fact "vi" will even append such a EOF char to a file if it was missing.
Generate a file with "touch", it will have 0 characters. Now open this in "vi", write some text, delete it completely (this way "vi" thinks you have changed the file, do NOT use the undo-function) and save the file. You will notice that it has also 1 character in it - the EOF char.
The short answer is: you can't The single char "ls" shows is the End-of-File-character (literally a "^D") and it isn't possible with "vi" to delete it. In fact "vi" will even append such a EOF char to a file if it was missing.
Generate a file with "touch", it will have 0 characters. Now open this in "vi", write some text, delete it completely (this way "vi" thinks you have changed the file, do NOT use the undo-function) and save the file. You will notice that it has also 1 character in it - the EOF char.
I hope this helps.
bakunin
Sorry, but no. UNIX text files do not have an End-of-File character. Each line in a text file is terminated by a <newline> character. If you have a file open in vi and issue the commands:
(which deletes all lines in the file), the size of file will be 0 bytes.
If you have exactly one line in a file and you edit it with vi and delete all of the characters on the line by repeatedly executing the x command until the line is empty and then issue the command: :w file
then the size of file will be 1 byte because you didn't delete the line, you just deleted the characters on the line preceding the terminating <newline> character.
The current line (including the terminating <newline> character can also be deleted in vi with the dd command.
These 2 Users Gave Thanks to Don Cragun For This Post:
Hi Guys,
My requirement is to remove any invisible and special characters from the file like control M(carriage return) and alt numerics and it should not replace @#!$%
abc|xyz|acd¥£ó
adc|123| 12áí
Please help on this.
Thanks
Rakesh (1 Reply)
Hi Guys,
My requirement is to remove any invisible and special characters from the file like control M(carriage return) and alt numerics and it should not replace @#!$%
abc|xyz|acd¥£ó
adc|123| 12áí
Please help on this.
Thanks
Rakesh (1 Reply)
Thank you for 4 looking this post.
We have a tab delimited file where we are facing problem in a lot of funny character. I have tried using awk but failed that is not working.
In the 5th field ID which is supposed to be a integer only of that file, we are getting corrupted data as below.
I... (12 Replies)
Hi Gurus,
I have file which contains some unicode charachator like "ü". I want to replace it with some charactors. I searched in internet and got command sed "s/ü/-/g", but I don't know how to type ü in unix command line.
Please help me for this one.
Thanks in advance (7 Replies)
Hello all
I am getting data like
col1 | col2 | col3
asdafa | asdfasfa | asf*&^sgê
345./ |sdfasd23425^%^&^ | sdfsa23
êsfsfd | sf(* | sdfsasf
My requirement is like
I have to to read the file and remove all special characters and hex characters ranging form 00-1f from 1st column, remove %"'... (1 Reply)
I finally figured out how to remove a file or directory with special characters in the name. It's kind of rudimentary so I thought I would share it with everyone:
find .inum -exec rm -rf {} \; (7 Replies)
hello all
I am writing a perl code and i wish to remove the special characters for text.
I wish to remove all extended ascii characters. If the list of special characters is huge, how can i do this using substitute command
s/specialcharacters/null/g
I really want to code like... (3 Replies)
Hi All,
i am trying to remove all special charecters().,/\~!@#%^$*&^_- and others from a tab delimited file.
I am using the following code.
while read LINE
do
echo $LINE | tr -d '=;:`"<>,./?!@#$%^&(){}'|tr -d "-"|tr -d "'" | tr -d "_"
done < trial.txt > output.txt
Problem
... (10 Replies)
Dear Members,
We have a file which contains some special characters. I need to replace these special character by a new line character(\n).
The Special character is \x85.
I am not sure what this character means and how we can remove it.
Any inputs are greatly appreciated.
Thanks... (5 Replies)