Making file with values from different files

Hello,

I am stuck up in middle of a script.Pls have a look at the problem and help me in any way out for the same.

There are n number of files with n number of contents in a column.
for example :
file1 has contents in quotes
"abcd"
"1234-asbcd"
"12312".....

file2 has contents in quotes
"123csdfd"
"qwdqdq"
"qweqe"......

file3 has contents in quotes
"123csdfQ13"
"qwdqd12"
"qweqe111"......

and so on ........

The desired output which is expected is as below :
output file -----
fileoutput.abcd,NAME="abcd",ID="123csdfd",DESC="123csdfQ13";
fileoutput.abcd,NAME="1234-asbcd",ID="qwdqdq",DESC="qwdqd12";
fileoutput.abcd,NAME="12312",ID="qweqe",DESC="qweqe111";
.......
and so on .

I have tried many things like while loop, for loop but got no success

can anyone pls help urgently

Thanks inadvance
Aparna

Try with file descriptors.

exec 4<file1 5<file2 6<file3
while read name; do
  read id <&5
  read desc <&6
  echo "fileoutput.abcd,NAME=$name,ID=$id,DESC=$desc;"
done <&2 >output   # BUG: should be <&4

Hi era,

I tried the solution given by you but no success,
the code hangs and doesn't comes out to shell prompt.

Pls suggest somthg

Thanks

Oops, sorry, the last one after done should be <&4

My bad )-:

HI Era,

Thanks a lot it Worked for me :slight_smile:

MANY MANY THKS TO U

Tc- Aparna