another quesion to merge file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting another quesion to merge file
# 1  
Old 03-20-2010
another quesion to merge file

hi experts

yesterday, I asked a question that is very like today's quesion, I think this one will be more difficult than yesterday, I really want to get the answer
so I post here again
file1
Code:
arch : x86
install : pass 
make os : pass
make build kernel : pass=100 failed=45


file2
Code:
arch : ppc
install : failed 
make os : http://kernel.org[/URL]
make build kernel : pass=104 failed=43
usb storage pass  : testing

file3
Code:
arch : arm
install : pass 
make os : pass

file4 .....


I don't know I have how many file I have maybe I have file5 file6......,
merge to

Code:
| x86 | pass | pass | pass=100 failed=45 |
| ppc | failed | http://kernel.org[/URL] | pass=104 failed=43 | testing |
| arm | pass | pass |

---------- Post updated at 10:54 AM ---------- Previous update was at 10:36 AM ----------

sorry to interrupt you, I have find the answer from my last post thanksdanmero and Franklin52 and others

Code:
awk -F" :" 'f!=FILENAME{if(s)print s ;f=FILENAME;s="|" $NF " |";next}{s=s $NF " |"}END{print s}' file*


Last edited by radoulov; 03-20-2010 at 05:34 PM.. Reason: Code tags, please!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk can't open file; file merge attempt

Dear all, I have an AWK related issue. I have two data files; the first, FileA has fewer lines, the second, FileB has more. FileA is a subset of FileB . Both files are tab delimited. What I want to do? When the first two columns for FileA match the first two columns of FileB, I want to... (4 Replies)
Discussion started by: A_Human_Person
4 Replies

2. Programming

noob error quesion

Hey, I a newbie in unix programming. I type the following command if ((configfd = open(CONFIGFILE, O_CREAT | O_WRONLY)) == -1) and the result I get from open is -1, which means error. how can I figure out the cause of the error ? (2 Replies)
Discussion started by: mellowcandle
2 Replies

3. Shell Programming and Scripting

merge two file

how to merge two file, i have 2 input file; file_1 & file_2, so i want the output file_3 as below file_1 NAME aa 111 222 bb.txt 111 222 cc 111 111 dd 222 ee 111 222 (4 Replies)
Discussion started by: zulabc
4 Replies

4. Shell Programming and Scripting

I suspect a simple quesion

I bet this is really simple but I can only find silly long solutions. Im trying to read the second word of each line in a file and pipe it out, in Win32 it looks something like: for /F "tokens=2" %%b in (file.txt) do etc.. Sorry for the probably dumbass question! (1 Reply)
Discussion started by: joe19oo.c
1 Replies

5. Programming

Merge files from /etc to one file using C

Hi guys, I have a question which might be easy to answer but I don't how to do it. The thing is I need to make a program in C which creates a file with all the content from the files in \etc. I'm not new to C language but to UNIX. I've read somewhere I need to use functions like f_read... (2 Replies)
Discussion started by: sussil
2 Replies

6. Shell Programming and Scripting

[Bash]Attempting to Merge text from one file into another file at the line directly under a word

Hello, This is my first post on the forums. So I want to start by thanking anyone who is kind enough to read this post and offer advise. I hope to be an active contributor now that I've found these forums. I have an issue that I figure would be a good first post.. I have 2 text files... (5 Replies)
Discussion started by: efciem
5 Replies

7. Solaris

xterm quesion

Can we throw a window from solaris to Linux redhat? (1 Reply)
Discussion started by: mokkan
1 Replies

8. UNIX for Dummies Questions & Answers

file merge

Hi, I have 3 files. The containts of the files are as followes. File 1: 1 2 3 File 2: A B C File 3: Ind US Aus (6 Replies)
Discussion started by: siba.s.nayak
6 Replies

9. Solaris

pam module quesion

quick question about PAM module. Here may pam.conf file. How do I verify that pam modules work correctly? Does it mean when it run cron job, it checks the pam module for authentication? Thanks in advance. # passwd auth required pam_passwd_auth.so.1 # # cron service (explicit... (0 Replies)
Discussion started by: mokkan
0 Replies

10. UNIX for Dummies Questions & Answers

Another "green horn" quesion.

I have read this thread : http://forums.unix.com/showthread.php?threadid=75 Which was very informative, but I still have a question or two. I am getting ready to put a box together and put UNIX on it so when I buy the first two books listed I can start practicing. That said, what version of... (2 Replies)
Discussion started by: ICE
2 Replies
Login or Register to Ask a Question