hi, i have an awk script and I managed to figure out how to search the max value but Im having difficulty in searching for the min field value.
BEGIN {FS=","; max=0}
NF == 7 {if (max < $6) max = $6;}
END { print man, min}
where $6 is the column of a field separated by a comma (3 Replies)
Hi All,
I have a file which is having 3 columns as (string string integer)
a b 1
x y 2
p k 5
y y 4
.....
.....
Question:
I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Hi guys!
I'm new to scripting and I need to write a script in awk.
Here is example of file on which I'm working
ATOM 4688 HG1 PRO A 322 18.080 59.680 137.020 1.00 0.00
ATOM 4689 HG2 PRO A 322 18.850 61.220 137.010 1.00 0.00
ATOM 4690 CD ... (18 Replies)
Hi guys,
I already search on the forum but i can't solve this on my own.
I have a lot of files like this:
And i need to print the line with the maximum value in last column but if the value is the same (2 in this exemple for the 3 last lines) i need get the line with the minimum value in... (4 Replies)
Is it possible to print the records that has only 1 value in 2nd column.
Ex:
input
awex1 1
awex1 2
awex1 3
assww 1
ader34 1
ader34 2
output
assww 1 (5 Replies)
Hi,
I need your kind help to get min and max values from file based on value in $5 .
File1
SP12.3 stc 2240806 2240808 + ID1_N003 ID2_N003T0
SP12.3 sto 2241682 2241684 + ID1_N003 ID2_N003T0
SP12.3 XE 2239943 2240011 + ID1_N003 ID2_N003T0
SP12.3 XE 2240077 2241254 + ID1_N003 ... (12 Replies)
Hi,
I have multiple files that each contain four columns of strings:
File1:
Code:
123 abc gfh 273
456 ddff jfh 837
789 ghi u4u 395
File2:
Code:
123 abc dd fu
456 def 457 nd
891 384 djh 783
I want to compare the strings in Column 1 of File 1 with each other file and Print in... (3 Replies)
I am trying to use awk to print the unique entries in $2
So in the example below there are 3 lines but 2 of the lines match in $2 so only one is used in the output.
File.txt
chr17:29667512-29667673 NF1:exon.1;NF1:exon.2;NF1:exon.38;NF1:exon.4;NF1:exon.46;NF1:exon.47 703.807... (5 Replies)
Hello experts,
I am converting a number into its binary output as :
read n
echo "obase=2;$n" | bc
I wish to count the maximum continuous occurrences of the digit 1.
Example :
1. The binary equivalent of 5 = 101. Hence the output must be 1.
2. The binary... (3 Replies)
For some reason I am having difficulty performing what should be a fairly easy task. I would like to print lines of a file that have a unique value in the first field. For example, I have a large data-set with the following excerpt:
PS003,001 MZMWR/ L-DWD// *
PS003,001... (4 Replies)
Discussion started by: jvoot
4 Replies
LEARN ABOUT DEBIAN
template::plugin::clickable
Template::Plugin::Clickable(3pm) User Contributed Perl Documentation Template::Plugin::Clickable(3pm)NAME
Template::Plugin::Clickable - Make URLs clickable in HTML
SYNOPSIS
[% USE Clickable %]
[% FILTER clickable %]
URL is http://www.tt2.org/
[% END %]
this will become:
URL is <a href="http://www.tt2.org/">http://www.tt2.org/</a>
DESCRIPTION
Template::Plugin::Clickable is a plugin for TT, which allows you to filter HTMLs clickable.
OPTIONS
target
[% FILTER clickable target => '_blank' %]
[% message.body | html %]
[% END %]
"target" option enables you to set target attribute in A links. none by default.
finder_class
"finder_class" option enables you to set other URI finder class rather than URI::Find (default). For example,
[% FILTER clickable finder_class => 'URI::Find::Schemeless' %]
Visit www.example.com/join right now!
[% END %]
this will become:
Visit <a href="http://www.example.com/join">www.example.com/join</a> right now!
NOTE
If you use this module with "html" filter, you should be careful not to break tags or brackets around the URLs. For example if you have a
following URL form,
<http://www.example.com/>
Clickable plugin will filter this into:
<a href="http://www.example.com/"><http://www.example.com/></a>
which is bad for HTML viewing. However, if you HTML filter them first and then clickable filter, you'll get:
<<a href="http://www.example.com/>">http://www.example.com/></a>;
which href part is wrong.
You'd better try Template::Plugin::TagRescue in this case.
[% USE Clickable -%]
[% USE TagRescue -%]
[% FILTER html_except_for('a') -%]
[% FILTER clickable -%]
<http://www.example.com/>
[%- END %]
[%- END %]
will give you the right format.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template, URI::Find, Template::Plugin::TagRescue
perl v5.8.8 2006-11-23 Template::Plugin::Clickable(3pm)