Hi Guys,
Sorry to bother everyone again here, but I ran into a small problem that has been after me for some time now.
I have a file called file1.txt and has following content -
PHP Code:
/folder1/fold/folder 10k
/folder167fold/folder 10MB
/folder2/fold/folder 10G
etc..
etc..
There is another file called file2.txt and has following content.
PHP Code:
folder1
folder5
test5
test5
Now I am trying to merge these two into one separate file where it should look like -
PHP Code:
/folder1/fold/folder 10k ; folder1
/folder167fold/folder 10MB ; folder5
/folder2/fold/folder 10G ; test5
etc..
etc..
So basically, I am just trying to append content of the 2nd file into file 1 at the end of each line.
I can certainly use sed 's/$/ ;FS folder1/' file 2 > output.txt however, it doesn't do the work for me since it can't add recursive content on each line of fil1.
I tried using paste -d ';' file file 2 > output.txt but it's not appending and its actually simply adding file 2 content at the end of file 1 in the final list.
Can someone please suggest me where i can append file 2 data into file1??
I am using a do -while loop as well by trying to read content of each line and then adding it to each line of file1.
Any suggestions or recommendation are of course welcome.
Thanks,
Morgan.