![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read file until certain line position | finalight | Shell Programming and Scripting | 5 | 05-21-2008 12:16 AM |
| read the file line by line | kittusri9 | Shell Programming and Scripting | 3 | 04-24-2008 05:26 AM |
| How to read last line of a txt file? | yongho | UNIX for Dummies Questions & Answers | 2 | 06-13-2005 10:20 AM |
| read line from file | rein | Shell Programming and Scripting | 5 | 04-14-2005 11:32 PM |
| How to read from a file line by line and do stuff | spaceship | Shell Programming and Scripting | 4 | 03-17-2005 06:47 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
I am relatively new to UNIX.
I am having a flat file with around 20,000 lines in it. Basically, it is a dump of a database table with tab character as a delimeter. I want to read the file row by row and process every row. Any suggestions about achieving it efficiently?? Thanks VEN |
| Forum Sponsor | ||
|
|
|
#3
|
|||
|
|||
|
What do you mean by process the file?
Unix has some great text handling abilities. All of them work on a line by line basis. |
|
#4
|
|||
|
|||
|
Result is not getting stored in the variable
alert_val=$( db2 "select value (( select distinct 1 from opus.alerts where alname = 'MQ_FAILURE_INTERFACE' and
aldatetime > current timestamp - 20 minutes),0) from sysibm.sysdummy1 with ur" | sed -n '/--/ {n; p;}') Can you tell me why alert_val not able to hold the value This is my question not the post reply Please do not hijack other people's threads Last edited by jim mcnamara; 10-30-2008 at 08:05 AM. |
|
#5
|
|||
|
|||
|
Read line by line:
Code:
while read file_rec
do
# file_rec is the current line of text in the file
echo "$file_rec"
done < inputfilename > newfilename
|
|||
| Google The UNIX and Linux Forums |
| Tags |
| line by line |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|