Link to home
Start Free TrialLog in
Avatar of hatem_from_mesr
hatem_from_mesrFlag for Egypt

asked on

how to make gedit display the control characters if any exist in the file

hi all,
if my scripts that I wrote or received act strangly because of control characters exist in the code that reverse program flow
does their any way to make gedit display it so that I can see it and delete it easily and if there is not what is the easy and woriking practical technic to do it
please send me a working example to test it since it's an occasionlly problem not daily
please reply as soon as possible
regards
hatem gamal
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

how these scripts are transferred to the system? if these are text files that are transferred via ftp, then you can either transfer in text / ascii mode , or run dos2unix on these files.

you may use vi or vim editors to open files.
Avatar of hatem_from_mesr

ASKER

hi omarfarid,
thanks for reply does that means gedit can't display control characters to the editor to remove them???
I never used it, but I can imagine that it is a text editor :) The man page says that it is a simple text editor.

But how the files are created and copied to your system?
do you know any text editor or tool that do the task of removing harmful control characters
if the answer is yes please tell me.
regards
hatem gamal
can you show sample of these files?
hi omarfarid,
do you have a sample because I don't have
if you use vi editor then you can get rid of control char e.g. cntrl-M by substitue command:

:1,$s/^V^M//g

Please press cntrl-V followed by cntrl-M in the above example
hi omarfarid,

I'll say what I understood and please tell me if it's correct
vi editor  have substitute comand that can rid of control characters
can you please how to make the substitute command in vi
if you refer to previous comment I showed how to do it. If you are not familiar with vi, then

- vi filename
- press : key followed by 1,$ s/cntrl-Vcntrl-M//g followed by emter key Please note that is control V followed by control M. This is to replace a control M char in the whole file
hi omarfarid,
sorry for my ignorance please tell me waht do you mean by the emter key or do you means enter key  please tell me
best regards
hatem gamal
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial