Count line Length

I am trying to write a shell scrip that can give me the line length of a record that was in EBDIC and then converted to ASCII. Everything I try reports 1 yet the length is 2000+. I have tried

echo "Line length : ${#FILE}"
echo "FILE" |awk -F, '{print NF}'
awk '{lenth(file)}'

All I can tell is that there is a charcter or something that says end of line even i it is not end of line.

Can anyone give me another way to count every character in a line until the line break?

Is there a null string (\000) in the line?

No there is a ^k\204 at the start

How do you read the line into the variable?

What is the output when you pipe it through hexdump or od -c?

I am jut typing the code in on the command line so it is read in at FILE listed above

od -c gives me:

\v 204 \0

for the fist set of characters.

HOW is it read into the FILE variable?

What code do you use?

\0 is a NUL and ends the string.

Ok if \0 is null how do I get around that? These are all over the record and need to be counted.

I repeat:

HOW do you get the information into the FILE variable?

As I said befor I have used one of the line in my first post. I am reading in the raw converted file. After that I don't know what you mean by reading in the file. I am jsut typing in the file name.

Please post the code that puts the line into the variable, FILE.

echo "Filename.txt" |awk -F"\0", '{print NF}'
this is waht the code looks like. just like the first post.

PLEASE put code inside

```text
 ... 
```

tags.

  1. That was not in your first post

  2. It doesn't put anything into the FILE variable.

Where is the line that begins:

FILE=