10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
Discussion started by: cmccabe
4 Replies
2. UNIX for Advanced & Expert Users
I have the following data set about the snps ID txt file
POS ID
78599583 rs987435
33395779 rs345783
189807684 rs955894
33907909 rs6088791
75664046 rs11180435
218890658 rs17571465
127630276 rs17011450
90919465 rs6919430
and a gene... (7 Replies)
Discussion started by: marwah
7 Replies
3. Shell Programming and Scripting
for a in {1..100}
do
awk '{ sum+=$a} END {print sum}' a=$a file1 > file2
done
I know I will get only one number if following the code above, how can I get 100 sum numbers in file2? (2 Replies)
Discussion started by: wanliushao
2 Replies
4. Shell Programming and Scripting
Hi, I have a large data file, want to separate it into 100 part and export one specific field as a file; then I want to append each part's column into one file. How to realize that?
1 2 3 1
2 3 4 2
2 3 4 3
3 3 4 4
3 4 5 5
3 4 5 6
I want the last column of the data file, e.g divide it... (5 Replies)
Discussion started by: wanliushao
5 Replies
5. Shell Programming and Scripting
Hi
I search for certain values in a file across many directories using the following awk code
awk '/Sl.*thickness/ {Sl=$3;Tt=$NF}END{print Sl, Tt}' DILAT.DAT
What I would like to do is write out Sl and Tt obtained from these files from many directories to a single file. So for example if... (2 Replies)
Discussion started by: lost.identity
2 Replies
6. UNIX for Dummies Questions & Answers
Hi! Is there a way to append column and row header to a file in awk script.
For example if I have
Jane F 39 manager
Carlos M 40 system administrator
Sam F 20 programmer
and I want it to be
# name gend age occup
1 Jane F 39 manager
2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies
7. Shell Programming and Scripting
I had two files 1.txt 2.txt. I want a 3rd file(o/p) 3.txt like below based on the common elements from the first coulmns of 1.txt and 2.txt.
1.txt
11
12
13
14
15
16
17
18
19
20
21
2.txt (6 Replies)
Discussion started by: p_sai_ias
6 Replies
8. Shell Programming and Scripting
I had two files 1.txt 2.txt. I want a 3rd file(o/p) 3.txt like below (using awk)
1.txt
11 a1
12 a2
13 a3
14 a4
15 a5
16 a6
17 a7
18 a8
19 a9
20 a10
2.txt
14 b1
15 b2
16 b3 (8 Replies)
Discussion started by: p_sai_ias
8 Replies
9. UNIX for Dummies Questions & Answers
One of the fortunate things about posting in a "Dummies" forum is you probably aren't expecting a lot of out me...
I'm trying to pull fields from two lines in the same file(s), and then append them together in a new file.
So...I get a nice line-by-line of the first bit of data I'm looking... (6 Replies)
Discussion started by: Milano_EH3
6 Replies
10. Shell Programming and Scripting
Hi!
1. I have a parameter file containing path to log files. For this example both paths are the same, one is stated directly and the second using env variables.
/oracle/admin/orcl/bdump/:atlas:trc:N
${ORACLE_BASE}/admin/${ORACLE_SID}/bdump/:${ORACLE_SID}:trc:N
2. I try to parse the path... (1 Reply)
Discussion started by: lojzev
1 Replies