Computing.Net > Forums > Unix > How to detect EOF of a text file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to detect EOF of a text file

Reply to Message Icon

Name: Horace
Date: June 2, 2003 at 05:42:37 Pacific
OS: Solaris 9
CPU/Ram: Sparc Ultra
Comment:

Hi,
I am doing some records processing in a text file. I would like to know how can I read the lines repeatedly until the EOF character is reach?

All help is appreciated. Tks!



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: June 2, 2003 at 08:45:58 Pacific
Reply:

Hi:

I'm assuming you want to do it in a unix shell. a ksh method:

while txtline=$(line)
do
echo $txtline
done data.file
# thers a less than sign (for input) between
'done' and 'data.file'. This forum wipes that key out.

Regards,


Nails


0

Response Number 2
Name: Horace
Date: June 2, 2003 at 10:20:05 Pacific
Reply:

Hi Nails,

thanks for your reply. I'm using the bash. Anyway, I think there are similarities in syntax and implementations.

Rgds, Horace


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: How to detect EOF of a text file

How to conver a text file into .xls www.computing.net/answers/unix/how-to-conver-a-text-file-into-xls/7761.html

Parsing and emailing a text file www.computing.net/answers/unix/parsing-and-emailing-a-text-file-/6623.html

how to unzip and find a file? www.computing.net/answers/unix/how-to-unzip-and-find-a-file/8343.html