10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the awk below I am trying to match the value in $4 of file1 with the split value from $4 in file2. I store the value of $4 in file1 in A and the split value (using the _ for the split) in array. I then strore the value in $2 as min, the value in $3 as max, and the value in $1 as chr.
If A is... (6 Replies)
Discussion started by: cmccabe
6 Replies
2. Shell Programming and Scripting
In the awk below I am trying to print out those lines in file2 that are no between $2 and $3 in file1. Both files are
tab-delimeted and I think it's close but currently it is printeing out the matches. The --- are not part of the files they are just to show what lines match or fall into
the range... (6 Replies)
Discussion started by: cmccabe
6 Replies
3. UNIX for Dummies Questions & Answers
I want to print specific range of rows and then its columns using awk command.
lets say if a file contain 15 line then i need to print line 5 to 9.
awk '{print;for( NR>=5&&NR<=9); do; print "<tr>\n<td>"$1"</td><td>"$2"</td><td>"$3"</td>\n</tr" done}' xyz.csv
not sure what's wrong... (9 Replies)
Discussion started by: amyt1234
9 Replies
4. Shell Programming and Scripting
Hi Experts,
I am trying to get the output from a matching pattern but unable to construct the awk command:
file :
aa bb cc 11
dd aa cc 33
cc 22 45 68
aa 33 44 44
dd aa cc 37
aa 33 44 67
I want the output to be : ( if $1 match to "aa" start of the line,then print $4 of that line, and... (3 Replies)
Discussion started by: rveri
3 Replies
5. Shell Programming and Scripting
Hi all,
on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern.
the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/'
I need to include the... (1 Reply)
Discussion started by: siriche
1 Replies
6. Shell Programming and Scripting
Hi
file.in and file.out are in csv format. the code I have now is,
cat file.in | awk -F"," '!($1$2$3$4$5$6$7$8 in a){a;print $0}' > file.out
Here, I am printing entire line using $0. however, I want to print $1 to $150 and it should be in csv format. Cut -d is not good in performace.... (3 Replies)
Discussion started by: krishnix
3 Replies
7. Shell Programming and Scripting
Hi, Please read the whole thread.
I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well.
example:
PACKET DATA PROTOCOL CONTEXT DATA
APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID
10 ... (6 Replies)
Discussion started by: panapty
6 Replies
8. Shell Programming and Scripting
Team,
Could some one help me in Printing from matching word to end using awk
For ex:
Input:
I am tester for now
I am tester yesterday
I am tester tomorrow
O/p
tester for now
tester yesterday
tester tomorrow
i.e Starting from tester till end of sentence (5 Replies)
Discussion started by: mallak
5 Replies
9. Shell Programming and Scripting
Hi,
I have two comma separated files. I would like to see field 1 value of File1 exact match in field 2 of File2. If the value matches, then it should print matched lines from File2. I have achieved the results using cut, paste and egrep -f but I would like to use awk as it is efficient way and... (7 Replies)
Discussion started by: SBC
7 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