I tried and it seems that it doesn't work on my data: I just get calculations at the end of the output that don't really seem to make sense.
Could you please detail the code so I can investigate? Thank you very much
---------- Post updated at 03:07 PM ---------- Previous update was at 02:57 PM ----------
I thought I would give a more concrete example of my problem.
My input file is as follows:
with column 1 being a header of the row, and columns 2 to 7 being numerical values.
The output I would like is:
with:
column 1 = column 1 from the input
column 2 = maximum value of columns 2 to 4 from the input
column 3 = maximum value of columns 5 to 7 from the input
HI all
I'm trying to write an awk script to print the min and max value in a range(s) contained in another file - the range values are in $2
EG
114,7964,1,y,y,n
114,7965,1,y,y,n
114,7966,1,y,y,n
114,7967,1,y,y,n
114,7969,1,y,y,n
114,7970,1,y,y,n
114,7971,1,y,y,n
114,7972,1,y,y,n... (3 Replies)
Hi,
I am trying to use AWK to do some editing and formating of large tables of numbers and I am having trouble getting it to work. For brevities sake, I won't show the whole table, but I have a sample set of code:
und$ awk '{($2+0) > 50;print $1}' temp
2000 147
2008 128
2002 100
1999 47... (2 Replies)
Hello all,
Let's say we have this file :
$ cat inputfile
2
3
4
7
8
11
15
16
17
I'm trying to make a script with awk which gives as output the following : (4 Replies)
Hi All,
Is there a way to save a range in variable for later printing?
for example write somthing like this:
awk '
/pattern1/,/pattern2/{f=range}
/pattern3/{print f}
'
I don't know excatly what "range" could be but is there a way to do this? (8 Replies)
Can I print the minimum and maximum values of values in first 4 columns ?
input
3038669 3038743 3037800 3038400 m101c
3218627 3218709 3217600 3219800 m290
.............
output
3037800 3038743 m101c
3217600 3219800 m290 (2 Replies)
Hi everyone, I'm a new member at the forum
I have a file like this: field 2 values are either 0 or negative. file test4:
100815 -20
118125 0
143616 0
154488 0
154488 0
154488 -6
196492 -5
196492 -9
196492 -7
27332 0
29397 0
I would like to print a... (1 Reply)
Hi everyone, I'm a new member at the forum I mistakenly posted this elsewhere too.
I have a file like this: field 2 values are either 0 or negative. file test4:
100815 -20
118125 0
143616 0
154488 0
154488 0
154488 -6
196492 -5
196492 -9
196492 -7
27332 0... (5 Replies)
From the below table I want to print highest value and lowest value using awk script.
aaa 55 66 96 77
ggg 22 96 77 23
ddd 74 58 18 3
kkk 45 89 47 92
zzz 34 58 89 92
Thanks, Green
edit by bakunin: it sure is not news to you that you should use CODE-tags, no? And that we do not want such... (3 Replies)
Dear Unix Gurus,
I have a text file with multiple columns, for example, see sample.txt below
0 1 301
1 4 250
2 6 140
3 2 610
7 1 180I want to find the maximum in, say, column 3, normalise all the values to this maximum value (to 4 decimal places) and spit everything into a new... (2 Replies)
Hi,
I have a text file, which I am trying to parse.
File contents:
BEG
Id Job1
Id Stage1
1
EN
Id Job2
Id Stage2
BEG
Id2 Job3
Id Stage4
2
EN
I have to process the data in this between every BEG and EN. so I am trying to restrict the range and inside every... (1 Reply)