1752793 Members
6132 Online
108789 Solutions
New Discussion юеВ

Read text file

 
heaman1
Regular Advisor

Read text file

I have a text file and I tried to read it in different servers , A server ( which the server generate the file ) can vi and cat it , but others can't vi it but can cat it , can advise what is problem in my server ? thx
14 REPLIES 14
Vibhor Kumar Agarwal
Esteemed Contributor

Re: Read text file

How are you trying to read the file on other servers.

If you aren't FTP'ing the file, probably there is a file permission issue.
Vibhor Kumar Agarwal
Steven Schweda
Honored Contributor

Re: Read text file

> [...] can't vi it [...]

What does this mean? Do you get some error
message, or what?

What, exactly, did you do?
What, exactly, happened when you did it?

> [...] A server [...]
> [...] my server [...]

What are these servers? "uname -a"?

Where is the file? "ls -l"?
heaman1
Regular Advisor

Re: Read text file

thx replies,


This is not permission problem , when read it , it pops below , can advise what is wrong ? thx

├п┬г┬╕?^@?^@x^@m^@l^@ ^@v^@e^@r^@s^@i^@o^@n^@=^@"^@1^@.^@0^@"^@ ^@e^@n^@c^@o^@d^@i^$
^@<^@D^@o^@c^@u^@m^@e^@n^@t^@E^@l^@e^@m^@e^@n^@t^@>^@
^@ ^@ ^@<^@R^@e^@g^@D^@a^@t^@a^@>^@
^@ ^@ ^@ ^@ ^@<^@W^@a^@r^@r^@a^@n^@t^@y^@C^@a^@r^@d^@>^@0^@<^@/^@W^@a^@r^@r^@a^$
^@ ^@ ^@ ^@ ^@<^@B^@r^@a^@n^@d^@>^@K^@E^@F^@<^@/^@B^@r^@a^@n^@d^@>^@
Steven Schweda
Honored Contributor

Re: Read text file

> can advise what is wrong ?

No.

Do you ever _answer_ questions, or do you
only ask more?
Vibhor Kumar Agarwal
Esteemed Contributor

Re: Read text file

Post the output of below:

file

On system where working/non-working (both):
which vi
alias vi
Vibhor Kumar Agarwal
heaman1
Regular Advisor

Re: Read text file

file test.txt
test.txt: Little-endian UTF-16 Unicode character data

#which vi
/bin/vi
# alias vi
bash: alias: vi: not found
Dennis Handly
Acclaimed Contributor

Re: Read text file

>file test.txt
>test.txt: Little-endian UTF-16 Unicode character data

This is NOT a HP-UX text file. Nor is it HP-UX because file(1) isn't smart enough to know anything about UTF-16.

Is one server Linux? If so, this isn't valid for HP-UX and you would have to translate it to UTF-8.
Suraj K Sankari
Honored Contributor

Re: Read text file

hi,

Did you tried like this
cat test.txt >test1.txt
then vi test1.txt

Suraj
Dennis Handly
Acclaimed Contributor

Re: Read text file

>Suraj: Did you tried like this: cat test.txt > test1.txt

I'm not sure how this will be better, especially if "diff test.txt test1.txt" says the file are the same.