Apr 21, 2004 #1 johny2K Technical User Dec 19, 2001 184 CA i want to read a file, line-by-line, print/echo each line until it figure out it is the end of the row & exit. cheers!
i want to read a file, line-by-line, print/echo each line until it figure out it is the end of the row & exit. cheers!
Apr 21, 2004 #2 Salem Programmer Apr 29, 2003 2,455 GB You'll have to explain what "until it figure out it is the end of the row" means. A line - by definition - contains the end of a row, so reading line by line doesn't mean a great deal. -- Upvote 0 Downvote
You'll have to explain what "until it figure out it is the end of the row" means. A line - by definition - contains the end of a row, so reading line by line doesn't mean a great deal. --
Apr 23, 2004 Thread starter #3 johny2K Technical User Dec 19, 2001 184 CA sorry, i mean - after the very last "line" inside the file. Upvote 0 Downvote
Apr 23, 2004 Thread starter #4 johny2K Technical User Dec 19, 2001 184 CA last row - to be exact.. Upvote 0 Downvote
Apr 23, 2004 1 #5 PHV MIS Nov 8, 2002 53,708 FR Something like this ? while read buf do echo "$buf" done</path/to/inputfile Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 Upvote 0 Downvote
Something like this ? while read buf do echo "$buf" done</path/to/inputfile Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
Apr 24, 2004 #6 stefanwagner Programmer Oct 19, 2003 2,373 DE Why don't don't just use: Code: cat FILE ? Upvote 0 Downvote
Apr 25, 2004 #7 fredericofonseca IS-IT--Management Jun 2, 2003 3,324 PT Cat file" will not deal well with spaces if you wish to process line by line Read will read a full line "This is a line" and you can use it as a single variable, but if you use cat it will be 4 variables. And i assume that the issue here is not just to echo each line, but to do something with it. Regards Frederico Fonseca SysSoft Integrated Ltd http://www.syssoft-int.com Upvote 0 Downvote
Cat file" will not deal well with spaces if you wish to process line by line Read will read a full line "This is a line" and you can use it as a single variable, but if you use cat it will be 4 variables. And i assume that the issue here is not just to echo each line, but to do something with it. Regards Frederico Fonseca SysSoft Integrated Ltd http://www.syssoft-int.com
Apr 27, 2004 Thread starter #8 johny2K Technical User Dec 19, 2001 184 CA thanks PHV... it really works! Upvote 0 Downvote
Apr 27, 2004 Thread starter #9 johny2K Technical User Dec 19, 2001 184 CA you are right frederico... i want to manipulate each line that's being spitted ... Upvote 0 Downvote