Not able to read a file.

Hi,

I am trying to read a big file. If I try to open it in vi, it is telling "Line too long
". If I try to do wc -l test.log, it is telling "0 test.log".

Please let me know how can I know number of chars or lines in the file.

Thanks & Regards
Shesha

an

ls -l

will show the number of characters in the file.

It is an interesting question on the lines. If you cannot read it, what difference does it make. If you can read it, use whatever it is that can read it to tell you the number of lines. That's about the best I can suggest.

Guess you can do a dump of the file and count the number of line feeds.

What kind of file is it?
Nmber of lines: cat <file>|wc -l
Number of char on a line : First line?
head -1 <file>|wc -c

find out how many characters in it:

cat filename | wc -c

Beyond that, you will want to be aware of
<FS> or field separators; typically a tab character between say a first name and a last name field
<RS> or record separators; typically a return and/or line-feed character between records

Sometimes, files are written with different markers.

OK, if all else fails, the following is painful to view but will give you some good data on your file:

cat filename | od -An -t dC -w20 | more

Which will provide you with the ASCII code values for your filename. Note I included the more command so as to limit the display scroll to a page at a time. With an ASCII chart (check the internet if you don't have one), you should be able to follow along with what is in the file by converting the printable characters (A-Z, a-z, 0-9, ...) and paying attention to anything less than the space character (32) as these control characters can dramatically efect the data.