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. Shell Programming and Scripting
Trying to get the unique count of the below input, but if the text in beginning of $5 is a partial match to another line in the file then it is not unique.
awk
awk '!seen++ {n++} END {print n}' input
7 input
chr1 159174749 159174770 chr1:159174749-159174770 ACKR1
chr1 ... (2 Replies)
Discussion started by: cmccabe
2 Replies
3. Shell Programming and Scripting
Trying to combine strings that are a partial match to another in $1 (usually below it). If a match is found than the $2 value is added to the $2 value of the match and the $3 value is added to the $3 value of the match. I am not sure how to do this and need some expert help. Thank you :).
file
... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
I have test.xml XML file like
<Report account="123456" start_time="2014-09-08T00:00:00+00:00" end_time="2014-09-10T23:59:59+00:00" user="Dollar Tree" limit="1000000" more_sessions="some text ">
<Session ......rest of xml...............
I need output like
<Report>
<Session ......rest of... (3 Replies)
Discussion started by: kumars1331@gmai
3 Replies
5. Shell Programming and Scripting
if a variable has part of awk syntax stored in it. for eg: x=if($1>100)
can we substitute this variable in an awk statement.
based on above requirement can we execute something like:
awk '{x print $1}' infile (5 Replies)
Discussion started by: 47shailesh
5 Replies
6. Shell Programming and Scripting
Hi Folks -
I'm quite new to awk and didn't come across such issues before. The problem statement is that, I've a file with duplicate records in 3rd and 4th fields. The sample is as below:
aaaaaa|a12|45|56
abbbbaaa|a12|45|56
bbaabb|b1|51|45
bbbbbabbb|b2|51|45
aaabbbaaaa|a11|45|56
... (3 Replies)
Discussion started by: asyed
3 Replies
7. UNIX for Dummies Questions & Answers
hello all,
I wonder if anybody might be able to help with this.
I have file 1 and file2.
Both files may contain thousands of lines that have variable contents.
file1
234GH
5234BTW
89er
678tfg
234
234YT
tfg456
wert
78gt
gh23444 (7 Replies)
Discussion started by: Garrred
7 Replies
8. Shell Programming and Scripting
Hello,
Let's assume I have 100 files FILE_${m} (0<m<101). Each of them contains 100 lines and 10 columns.
I'd like to get in a file called "result" the average value of column 3, ONLY between lines 11 and 17, in order to plot that average as a function of the parameter m.
So far I can compute... (6 Replies)
Discussion started by: DMini
6 Replies
9. Shell Programming and Scripting
Hi,
I am having file which contains around 15 columns, i need to fetch column 3,12,14 based on the condition that column 3 starts with 40464
this is the sample data
how to achieve that (3 Replies)
Discussion started by: aemunathan
3 Replies
10. UNIX for Advanced & Expert Users
Id like to delete a line from a file using (preferably a single line unix command) if it contains a certain string pattern.
If line contains "abcdef" then delete that line.
Help greatly appreciated. (7 Replies)
Discussion started by: cronjob78
7 Replies