How to Read Multiple files in a Shell Script

Hi,

Can any one tell me if i can read two files in a shell script...

My actual requirement is to read the 1st text file and parse it to get the file code and use this file code to retrieve data from database and print the fetched data in the 2nd text file (I have parsed it and printed the fetched data)

Now i want to read the 2nd text file and get the value for further use in the script...

how should i go about it.

Thanks in advance

You mean something like this ?

while read i; do 
  get $filename from database using $i
  while read j; do 
    do stuff with $j
  done < "$filename" 
done < file1

ya got it thanks for the reply bro...