Computing.Net > Forums > Unix > read a file line by line in unix

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.

read a file line by line in unix

Reply to Message Icon

Name: trichyselva
Date: February 28, 2006 at 00:49:08 Pacific
OS: windows xp
CPU/Ram: p4
Product: pentium
Comment:

reading a file line by line in unix



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: February 28, 2006 at 09:03:09 Pacific
Reply:

#!/bin/ksh

while read line
do
echo $line
done < mydatafile



0

Response Number 2
Name: gpatel
Date: March 10, 2006 at 09:36:44 Pacific
Reply:

thanks nail. this kind of solved my problem too. Now, i have a question about this. I have this files that print garbage charactors. Its very hard to define those charactors and hard to find it too. and these charactors are different for different editors ( what i mean is if i open in nedit it will be like <soh> , if i open in text edit its like ^@).

what your script does it read line by line so its gonne stop at this perticular line and just gonne think and not do anything. is there anyway to get out and print an error message?

Thanks for all your help.
gpatel
Note: this charactors doesnt work with grep or there is no way to find it.

thanks,
Gaurav


0

Response Number 3
Name: gpatel
Date: March 10, 2006 at 11:04:59 Pacific
Reply:

nails, no help needed.
Thanks


thanks,
Gaurav


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: read a file line by line in unix

Reading a file line by line www.computing.net/answers/unix/reading-a-file-line-by-line/5633.html

print a file line-by-line www.computing.net/answers/unix/print-a-file-linebyline/4099.html

read text file, till str, write res www.computing.net/answers/unix/read-text-file-till-str-write-res/6395.html