08-05-2009
combining 2 files into one according to the list
hi, i have a list of file:
KB0002 KB215027
KB0003 KB215027
KB0004 KB215027
KB0005 KB204320
KB0006 KB207074
KB0007 KB215204
KB0008 KB223809
KB0009 KB236640
KB0010 KB244506
KB0011 KB205382
KB0012 KB212813
KB0013 KB236314
KB0014 KB230897
KB0015 KB232532
KB0016 KB231543
KB0017 KB214428
KB0018 KB244695
KB0019 KB207217
where 1st filename corresponds to the other one
All I need is a script that merge two files into one according to my list
Any ideas?
Thx in advance
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how will i combine these 2 files below, with the desired output
specified below:
file1:
one
two
three
four
file2:
red
blue
yellow
green
file3:
aaa
bbb
ccc
ddd (3 Replies)
Discussion started by: apalex
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
is there a way to combine 2 files together, joining line 1 from file A with line 1 from file B, line 2 from A with line 2 from B etc.
File A File B
1 4
2 5
3 6
Combined result =
File C
14
25
36 (2 Replies)
Discussion started by: Enda Martin
2 Replies
3. Shell Programming and Scripting
I have two files which contain data from two different transactions in the same format:
<Name> - <Count>
My goal is to end up with data in this format after combining the two:
<Name> - <Count1> - <Count2>
Is this possible to do with awk, or is there something better?
Thanks... (3 Replies)
Discussion started by: bat711
3 Replies
4. Shell Programming and Scripting
Could someone help me reduce the number of runs for a shell program I created?
I have two text files below:
$ more list1.txt
01 AAA
02 BBB
03 CCC
04 DDD
$ more list2.txt
01 EEE
02 FFF
03 GGG
I want to combine the lines with the same number to get the below:
01 AAA 01 EEE
02... (4 Replies)
Discussion started by: stevefox
4 Replies
5. Shell Programming and Scripting
I have two files and I need to combine (not append - but combine a row to a row)
eg:
File1:
apples
grapes
oranges
lemons
File2:
red
green
orange
yellow
After combining, the file should look like: (the second column should start at a specific byte)
apples red
grapes green... (7 Replies)
Discussion started by: hemangjani
7 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have two list I wanna combine and print them together in the output depending if they have the same rsid:
file1:
ENST00000262042 rs47 583 N D
ENST00000408005 rs48 583 N D
ENST00000311322 rs268 318 N S
file 2:
rs34 CHB T 1 C 0 T/T C/T C/C 1 0 0
rs47 JPT T 1 C 0 T/T C/T C/C 1 0 0
rs48... (6 Replies)
Discussion started by: karla
6 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below,
1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
Discussion started by: dsfreddie
1 Replies
8. Shell Programming and Scripting
i am having 2 files like this
file 1
1,
2,
3,
4,
file2
5,
6,
7,
8,
what i want do is like this
i want to put all the contents for file 2 after file 1,means adding column in file1 (5 Replies)
Discussion started by: sagar_1986
5 Replies
9. Shell Programming and Scripting
Hi I have about 108 files (text files) that end with .avg and each one of these files have a distinct name that describes what is in the file. In each file there is a set of 80 values that are tab separated. I want to combine all 108 files into ONE main file.
So each file is named:
1.avg... (5 Replies)
Discussion started by: phil_heath
5 Replies
10. Shell Programming and Scripting
HI,
I have requirement to fetch the list of files except the ok file by connecting to other server and then copy all the files that are fetched using the below command.
ssh ${aSrcHOST} ls ${aSrcDIR}/grep -vi OK$ > filelist.txt
The above code is also picking up any directory names and... (7 Replies)
Discussion started by: Nikhath
7 Replies
LEARN ABOUT CENTOS
stap-merge
STAP-MERGE(1) General Commands Manual STAP-MERGE(1)
NAME
stap-merge - systemtap per-cpu binary merger
SYNOPSIS
stap-merge [ OPTIONS ] [ INPUT FILENAMES ]
DESCRIPTION
The stap-merge executable applies when the -b option has been used while running a stap script. The -b option will generate files per-cpu,
based on the timestamp field. Then stap-merge will merge and sort through the per-cpu files based on the timestamp field.
OPTIONS
The systemtap merge executable supports the following options.
-v Verbose mode, displays three extra fields per set of collected data.
[cpunumber,sequencenumberofdata,thelengthofthedataset]
-o OUTPUT_FILENAME
Specify the name of the file you would like the output to be redirected into. If this option is not specified than the output will
be pushed to standard out.
EXAMPLES
$ stap -v -b -e 'probe syscall.open { printf("%s(%d) open
",
execname(), pid()) }'
This should result in several stpd_cpu files (each labled with a number representing which cpu the file was produced from).
$ stap-merge -v stpd_cpu0 stpd_cpu1
Running the stap-merge program in the same directory as the stap script earlier in the example, will produce an ordered sequence of packets
with the three part label for each set of data. This result will be pushed through the standard output. An output file could have been
specified using the "-o" option.
FILES
Important files and their corresponding paths can be located in the
stappaths(7) manual page.
SEE ALSO
stapprobes(3stap),
stappaths(7),
staprun(8),
stapvars(3stap),
stapex(3stap),
stap-server(8),
gdb(1)
BUGS
Use the Bugzilla link of the project web page or our mailing list. http://sourceware.org/systemtap/,<systemtap@sourceware.org>.
STAP-MERGE(1)