10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the awk below I am trying to get the average of the sum of $7 if the string in $4 matches in the line below it. The --- in the desired out is not needed, it is just to illustrate the calculation. The awk executes and produces the current out. I am not sure why the middle line is skipped and the... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. UNIX for Beginners Questions & Answers
I apologize in advance, but I continue to have trouble searching for matches between two files and then printing portions of each to output in awk and would very much appreciate some help.
I have data as follows:
File1
PS012,002 PRQ 0 1 1 17 1 0 -1 3 2 1 2 -1 ... (7 Replies)
Discussion started by: jvoot
7 Replies
3. Shell Programming and Scripting
In the awk below I am trying to set/update the value of $14 in file2 in
bold, using the matching NM_ in $12 or $9 in file2
with the NM_ in $2 of file1.
The lengths of $9 and $12 can be variable but what is consistent is the start pattern
will always be NM_ and the end pattern is always ;... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
Hello,
I am looking to output all of the lines from file2 whose 11th field is present in the first field in file1. Then the second field from file1 should be appended as such:
file1:
2222 0.35
4444 0.25
5555 0.75
file2:
col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 1111
col1 col2... (4 Replies)
Discussion started by: palex
4 Replies
5. Shell Programming and Scripting
this is part of a KT i am going thru.
i am writing a script in bash shell, linux where i have 2 columns where 1st signifies the nth hour like 00, 01, 02...23 and 2nd the file size.
sample data attached.
Desired output is 3 columns which will give the nth hour, number of entries in nth hour and... (3 Replies)
Discussion started by: alpha_1
3 Replies
6. Shell Programming and Scripting
Hello,
I have a file with such structure:
>ENSGALG00000000011|ENSGALT00000000012|57|1123|1125
AACTGTGTGTTTTTT
>ENSGALG00000000012|ENSGALT00000000013|57|1145|1155
AAAAAAGGTCCTGTGTGC
>ENSGALG00000000015|ENSGALT00000000014|57|1144|1155
AAAATGTGTGTGTGTGTGTGTG
I want to use another file... (8 Replies)
Discussion started by: Homa
8 Replies
7. Shell Programming and Scripting
I have a flat file
test.log
red,5,,,,,
green,7,,,,,
blue,4,,,,,
red,8,,,,,
green,9,,,,,
How i get a a result:
blue,4,,,,,
green,16,,,,,
red,13,,,,,
Thanks
Video tutorial on how to use code tags in The UNIX and Linux Forums. (2 Replies)
Discussion started by: sabercats
2 Replies
8. Shell Programming and Scripting
I have about 20 CSV's that all look like this:
"","","","","","","","","","","","","","","",""What I've been told I need to produce is the exact same thing, but with each file now containing the start_code from every other file where the email matches.
It doesn't matter if any of the other... (1 Reply)
Discussion started by: Demosthenes
1 Replies
9. Shell Programming and Scripting
One file (file1) is as such:
Abc.txt 1.1 1.3
Abc_v2.txt 1.1 1.4
Tree.txt 1.3 1.4
Grass.txt 1.3 4.5
The other (file2):
Horse.txt 1.1 ref23232
Abc.txt 1.1 1.2 ref 3232-3232 1.3 ref 3232-3232
Plane.txt 1.1 1.2 ref 3232-3232 1.3 ref 3232-3232 1.4
Tree.txt 1.3 ref 3232-3232 1.4... (5 Replies)
Discussion started by: linuxkid
5 Replies
10. Shell Programming and Scripting
Hi All,
I have a string like below:
str="Hold=True Map=False 'This will map the data' Run=Yes Modify=False"
I want to print the field Run=Yes and retrive the value "Yes". I cannot use simple awk command because the position of the "Run" will be different at different times. Is there a way... (6 Replies)
Discussion started by: deepakgang
6 Replies