10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
Sure it's an easy one, but it drives me insane.
input ("|" separated):
1|A,B,C,A
2|A,D,D
3|A,B,B
I would like to count the occurence of each capital letters in $2 across the entire file, knowing that duplicates in each record count as 1.
I am trying to get this output... (5 Replies)
Discussion started by: beca123456
5 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
First I'd like to apologize if I opened a thread which is already open somewhere.
I did a bit of searching but could quite find what I was looking for, so I will try to explaing what I need.
I'm writing a script on our server, got to a point where I have two files with results. Example:
File1... (6 Replies)
Discussion started by: mitabrev83
6 Replies
5. Shell Programming and Scripting
I would like to find the first matching row and continue to search from the matching row. if column3 equal to 1 in the row, find the next matching row based on the criteria below. column3 in the matching row equal to 0 and column2 equal to column2 in the matching row
test.csv - test data
... (7 Replies)
Discussion started by: chailee
7 Replies
6. UNIX for Dummies Questions & Answers
Hi folks,
I am very new to awk. I have what is probably a very simple question. I'm trying to get the max value of column 1, but also print column 2. My data looks like this:
0.044|2000-02-03 14:00:00
5.23|2000-02-03 05:45:00
5.26|2000-02-03 11:15:00
0|2000-02-01 18:30:00
So in this case... (2 Replies)
Discussion started by: amandarobe
2 Replies
7. Shell Programming and Scripting
Hi there,
I'm trying to use awk to print out the entire line that contains a match to a certain regex and then append some text,plus the match to the end of the line.
So far I have:
awk -F: '{print "RG:Z:" $2}' file
Which prints out the match I want plus the additional text, but I'm stuck... (3 Replies)
Discussion started by: jim_lad
3 Replies
8. Shell Programming and Scripting
I have an input that looks like this:
chr1 mm9_knownGene utr3 3204563 3206102 0 - . gene_id "Xkr4"; transcript_id "uc007aeu.1";
chr1 mm9_knownGene utr3 4280927 4283061 0 - . gene_id "Rp1"; transcript_id "uc007aew.1";
chr1 mm9_knownGene ... (5 Replies)
Discussion started by: pbluescript
5 Replies
9. Shell Programming and Scripting
Hi All,
I'm looking to use AWK to pattern match lines in XML file - Example patten for below sample would be /^<apple>/
The sample I wrote out is very basic compared to what I am actually working with but it will get me started
I would like to keep the matched line(s) unchanged but have them... (4 Replies)
Discussion started by: rhoderidge
4 Replies
10. Shell Programming and Scripting
Need to transpose every 2 fields of a row into a single 2 field column.
input
4 135 114 76 217 30 346 110
5 185 115 45 218 85 347 125
6 85 116 130 220 65 352 95
11 30 117 55 221 42 355 75
16 72 118 55 224 37 357 430
17 30 119 55 225 40 358 62
21 52 120 65 232 480 360 180
....... (8 Replies)
Discussion started by: sdf
8 Replies