10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a file.txt containing the following:
Query= HWI-ST863:386:C5Y8UACXX:3:2302:16454:89688 1:N:0:ACACGAAT
Length=100
Score E
Sequences producing significant alignments: (Bits) Value
... (2 Replies)
Discussion started by: tons92
2 Replies
2. Shell Programming and Scripting
string="din&esh\nisgood"
File.txt:
the name is
sed "s#\#${string}#g" File.txt
Output am getting:
the name is dinesh
is good
Expected output:
the name is din&esh\nisgood
The input string is dynamic it will be keep on changing
am able to handle & by placing \& in the string.. (5 Replies)
Discussion started by: dineshaila
5 Replies
3. Shell Programming and Scripting
Hi All,
I have problem in the middle of implementing to users, whereby the complaint is all about the decimal place which is too long. I need two decimal places only, but the outcome from command is always fixed to 6.
See the sample :
before:
Sort Total
Site Sort SortName Parts ... (3 Replies)
Discussion started by: horsepower
3 Replies
4. Shell Programming and Scripting
Hi, I am trying to do something like this ...
I use awk to match a pattern, and then print out all col.
My code is :
awk '{if ($1 ==300) print $1,$2-'$sbin7',$3}' tmp.txt
output=
300 2
whereby sbin7=2,
The thing is, I want to print all col and row, not just the matched line/row only, but... (10 Replies)
Discussion started by: horsepower
10 Replies
5. Shell Programming and Scripting
Hi Guru's.
I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 :
awk '{ if ($5>80) && if ($5 != 100) print $0}
But getting error:
>bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}'
syntax error The source line is 1.
The error... (6 Replies)
Discussion started by: rveri
6 Replies
6. Shell Programming and Scripting
.......... (1 Reply)
Discussion started by: Antonlee
1 Replies
7. 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
8. Shell Programming and Scripting
Hi folks,
I have a text file that I need to parse, and I cant figure it out. The source is a report breaking down softwares from various companies with some basic info about them (see source snippet below). Ultimately what I want is an excel sheet with only Adobe and Microsoft software name and... (5 Replies)
Discussion started by: rowie718
5 Replies
9. Shell Programming and Scripting
I need only those records which has $2 equal to "DEF" independent of case (i.e upper or lower)
nawk -F"," '$2 ~ //{print $0}' file
This returns 3rd record also which i dont want
I tried this but this doesnt work as expected.
nawk -F"," '$2 == ""{print $0}' file
i dont... (3 Replies)
Discussion started by: pinnacle
3 Replies
10. Shell Programming and Scripting
Hi,
I need to awk some data from some text files, basic stuff, eg:
awk '/phrase/ {print $1,$2,$3}' file
Which will print columns 1 to 3 of all lines containing "phrase"
But what if I wanted to pipe just one of the columns to a command (in my case a date converter) as in:
awk... (4 Replies)
Discussion started by: Jonny2Vests
4 Replies