10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the below perl I am trying to extract and print the values AF1=, the GT value, and F or QUAL diveded by 33 (rounded to the nearest whole #). The GT value is at the end after the GT:PL so all the possibilities are read into a hash h, then depending on the value that is in the line the... (1 Reply)
Discussion started by: cmccabe
1 Replies
2. Shell Programming and Scripting
im trying to get
awk to print the string between 3rd and 4th backslashs to end of line
test could be any word
this
http://example.com/test/ >to this
http://example.com/test/ > testalso the other way round insert string at end of line... (13 Replies)
Discussion started by: bob123
13 Replies
3. UNIX for Dummies Questions & Answers
Hi,
OS = Solaris
Can anyone advise if there is a one liner to print specific output from a df -k output?
Running df from a command line, it sometimes gives me 2 lines for some volume. By re-directing the output to a file, it always gives 1 line for each.
Below is an example output,... (4 Replies)
Discussion started by: newbie_01
4 Replies
4. Shell Programming and Scripting
Hi!
I have a strange behaviour from sed and awk, but I'm not sure, if I'm doing something wrong:
I have a list of words, where I want to add the following string at the end of each line:
\;\;\;\;0\;1
I try like this:
$ cat myfile | awk '{if ( $0 != "" ) print $0"\;\;\;\;0\;1"}'
Result:... (5 Replies)
Discussion started by: regisl67
5 Replies
5. Shell Programming and Scripting
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies
6. Shell Programming and Scripting
I would like to print result of multiple search pattern invoked from an one liner. The code looks like this but won't work
gawk -F '{{if ($0 ~ /pattern1/) pat1=$1 && if ($0 ~ /pattern2/) pat2=$2} ; print pat1, pat2}'
Can anybody help getting the right code? (10 Replies)
Discussion started by: sdf
10 Replies
7. Shell Programming and Scripting
Hi
I am trying to search and replace a multi line pattern in a php file using awk.
The pattern starts with
<div id="navbar">
and ends with
</div>
and spans over an unknown number of lines.
I need the command to be a one liner.
I use the "record separator" like this :
awk -v... (8 Replies)
Discussion started by: louisJ
8 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. UNIX and Linux Applications
Hi to all! I 'm new in unix programing so... may be I decided a wrong tool to solve the problem but anyway... all road goes to rome jajaja.
My question is: There is any way to print date at the END clause of an AWK script. I mean, I'm writing a tool with AWK and the results are redirected to a... (4 Replies)
Discussion started by: fmeriles
4 Replies
10. Shell Programming and Scripting
Hi,
I want to Print starting 3rd line until end of the file. Pls let me know the command.
Thanks in advance. (1 Reply)
Discussion started by: smc3
1 Replies