[Solved] Looping var from two files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] Looping var from two files
# 1  
Old 11-12-2011
[Solved] Looping var from two files

Hey Guys,

I have been searching but unable to find solution for this;
Got 2 files:
Code:
#File A
A
B
C

#File B
1
2
3

And would like to 'merge' file and get a out put like;
Code:
A1
A2
A3
B1
B2
B3
C1
C2
C3

Would anyone have a suggest to do above ?
SH , Bash - no problem, I can do most env.

Thanks in advance for any suggestions

Last edited by vbe; 11-12-2011 at 07:13 AM.. Reason: Please use code tags for you code and data
# 2  
Old 11-12-2011
Code:
while read a;do while read b;do echo $a$b;done < file_b;done < file_a

# 3  
Old 11-12-2011
Worked like a charm.
Thank you, danmero very much for taking the time to help me solve the problem.Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Looping through Files

Hi all , I am new on this forum . I have to face a particoular implementation issue and I need some help . Requirement : I need to read a particoular file (an xml file) and after reading it I need to call an Oracle Stored Procedure passing the content of the file as paramenter , in order... (3 Replies)
Discussion started by: Kolas79
3 Replies

2. Shell Programming and Scripting

[SOLVED] Read html attachment from /var/mail

Hi, I am receiving an email to the server with a html attachment. When I check the /var/mail the attachment is showing as junk characters. I want to move that html file to a particular location in that server. Please help me. Regards Neethu (4 Replies)
Discussion started by: Neethu
4 Replies

3. Shell Programming and Scripting

[Solved] looping script issue

Hi all.. Need your help I want to combine 2 file into 1file File1 : A B C D File2 : 1 2 3 4 Result : A1 A2 A3 A4 B1 (3 Replies)
Discussion started by: buncit8
3 Replies

4. HP-UX

[Solved] /var directory in HP-UX is showing 95%?

Hi Everyone, My var directory is showing near to 100% ? What are the files should i delete to make it less?? Kindly suggest # bdf -i Filesystem kbytes used avail %used iused ifree %iuse Mounted on /dev/vg00/lvol3 1048576 107616 933616 10% 3342 29394 10% /... (10 Replies)
Discussion started by: yadvinder
10 Replies

5. Emergency UNIX and Linux Support

[Solved] /var is filling continuously

Hi All, I have Solaris-10 machine. Yesterday I patched it with Solaris-10 patch Cluster. Since then glance software is filling up /var/core continuously. In every few minutes, it will fill /var to 100%. Glance runs through /etc/init.d/mwa and I already stopped it, still core files are... (15 Replies)
Discussion started by: solaris_1977
15 Replies

6. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

7. Shell Programming and Scripting

[Solved] help me in this looping in shell scripting

Hi, #!/bin/ksh result='/TIA/app/UniQP/queue/document/CSB' i=0; while ; do i=`expr $i + 1` if ($i -lt 5);then echo "THerrFile_$i.err"; else break; fi done ... (0 Replies)
Discussion started by: sudhir_83k
0 Replies

8. Shell Programming and Scripting

looping through files

I am writing a ksh which has to load 7 files(.dat files) from input directory into oracle tables using sql loader. The process has to take each file at a time and once if it is loaded succesfully using sql loader into oracle tables then the process has to pick next file and load it into oracle... (2 Replies)
Discussion started by: vpv0002
2 Replies

9. Shell Programming and Scripting

Looping through files...

I posted this in the Solaris forum, but I don't think it's platform specific, so I'm posting it here. Here is the situation. We are a company that has been using a professional publishing system, the software is called "ProType". It runs on Solaris 2.4, however it is no longer supported and we... (6 Replies)
Discussion started by: Fred Goldman
6 Replies

10. Shell Programming and Scripting

Help looping through files, please...

Okay... I've solved one problem. Here's the next. I'm writing a script file that needs to go through a directory and list all files in that directory. I'm using TCL/TK. I figured out how to go through the directory and how to loop through it, but I ran into a little problem. ... (2 Replies)
Discussion started by: kapolani
2 Replies
Login or Register to Ask a Question