I am unable to view the data in a file using the vi editor.....it is showing as all @ ( at the rate symbols).
When I use the cat command, it showing the data.
Please help me to how to view the data in VI editor, as I need to edit the data. Even I tried to edit using sed but that couldn't help in editing it.
Thanks,
Surendra
Try od -c | more
to see if there are lots of control characters (i.e. between octal 000 and 017).
I cannot think of it offhand, but anyone familiar with tr
can give you a quick command to filter out non-printable characters. I just do not do that often enough to type it from memory.
I couldn't find any special character except space ( showing as sp) using the<code>od -c</code> command.
LANG=en_GB
LC_COLLATE="en_GB"
LC_CTYPE="en_GB"
LC_MONETARY="en_GB"
LC_NUMERIC="en_GB"
LC_TIME=C
LC_MESSAGES="en_GB"
LC_ALL=
I could also see another locale which is specific to the application
English_UnitedStates.Latin1@Binary
RudiC
February 20, 2013, 5:20am
6
Pls give us SOME lines of your file in binary, e.g. od -tx1 file
.
0000000 55 4e 42 2b 55 4e 4f 41 3a 33 2b 35 39 30 39 30
0000020 30 30 37 38 39 30 36 37 3a 31 34 2b 35 30 30 30
0000040 31 31 39 30 30 30 30 30 36 3a 31 34 2b 31 33 30
0000060 32 31 39 3a 30 38 31 31 2b 36 35 35 37 30 30 30
0000100 30 31 30 30 30 31 30 2b 2b 49 4e 56 4f 49 43 2b
0000120 2b 2b 2b 31 27 55 4e 48 2b 31 2b 49 4e 56 4f 49
RudiC
February 20, 2013, 6:31am
8
Can't see a reason why this should not be neither displayed nor edited correctly in unix, except maybe for a missing linefeed.
Could it be a vi configuration issue?
Missing line feed can be an issue (would see 0a as value).
And, - but rows of @ down the side do mean line too long too display - good call RudiC! - about missing linefeeds - I had forgotten that.
What you want is a program to break your lines into shorter pieces.
Here is a link to a article explaining how to use awk - will require reading and adjusting to your needs, but should get you an editable file.
Hello, I am currently trying to edit an ldif file. The ldif specification states that a newline followed by a space indicates the subsequent line is a continuation of the line. So, in order to search | The UNIX and Linux Forums
bakunin
February 21, 2013, 1:54am
10
True. Before writing an awk script you might want to consult the man page of fmt
. It might just do what you need.
I hope this helps.
bakunin