Hi,
This is my input file:
ali 5 usa abc
abu 4 uk bca
alan 6 brazil bac
pinky 10 utah sdc
My desired output:
pinky 10 utah sdc
alan 6 brazil bac
ali 5 usa abc
abu 4 uk bca
Based on the column two, I want to do the descending order and print out other related column at the... (3 Replies)
Hi ,
i am trying to prepare a text file by awk .
My code is like below
echo "$a $b $c $d $e $f $g $h "|nawk '{for(i=1;i<=5;i++){printf("%s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t\n", $1 , $2 ,$3 ,$4 ,$5 ,$6 ,$7 ,$8)}}' >> tempfile.txt
Now my req is $d will print as per user req . if user inputs... (2 Replies)
Hi friends,
My file is like:
Second file is :
I need to print the rows present in file one, but in order present in second file....I used
while read gh;do
awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile
done < secondfile
but the output I am... (14 Replies)
Dear All,
I have a data file input.csv like below. (Only five column shown here for example.)
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
3,2,4,5,6
5,3,5,5,6
From this I want the below output
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
where the second column... (4 Replies)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Input file :
5 20
500 2
20 41
41 0
23 1
Desired output :
5
2
20
0
1
By comparing column 1 and 2 in each line, I hope can print out the column with smallest number.
I did try the following code, but it don't look good :( (2 Replies)
Need your support for below. Please help to get required output
If column 5 is INV then only consider column1 and take out duplicates/identical rows/values from column1 and then put minimum value of column6 in column7 and put maximum value in column 8 and then need to do subtract values of... (7 Replies)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Discussion started by: TestPractice
5 Replies
LEARN ABOUT OPENDARWIN
funcombine
funcombine(7) SAORD Documentation funcombine(7)NAME
FunCombine - Combining Region and Table Filters
SYNOPSIS
This document discusses the conventions for combining region and table filters, especially with regards to the comma operator.
DESCRIPTION
Comma Conventions
Filter specifications consist of a series of boolean expressions, separated by commas. These expressions can be table filters, spatial
region filters, or combinations thereof. Unfortunately, common usage requires that the comma operator must act differently in different
situations. Therefore, while its use is intuitive in most cases, commas can be a source of confusion.
According to long-standing usage in IRAF, when a comma separates two table filters, it takes on the meaning of a boolean and. Thus:
foo.fits[pha==1,pi==2]
is equivalent to:
foo.fits[pha==1 && pi==2]
When a comma separates two spatial region filters, however, it has traditionally taken on the meaning of a boolean or. Thus:
foo.fits[circle(10,10,3),ellipse(20,20,8,5)]
is equivalent to:
foo.fits[circle(10,10,3) || ellipse(20,20,8,5)]
(except that in the former case, each region is given a unique id in programs such as funcnts).
Region and table filters can be combined:
foo.fits[circle(10,10,3),pi=1:5]
or even:
foo.fits[pha==1&&circle(10,10,3),pi==2&&ellipse(20,20,8,5)]
In these cases, it is not obvious whether the command should utilize an or or and operator. We therefore arbitrarily chose to implement the
following rule:
o if both expressions contain a region, the operator used is or.
o if one (or both) expression(s) does not contain a region, the operator used is and.
This rule handles the cases of pure regions and pure column filters properly. It unambiguously assigns the boolean and to all mixed cases.
Thus:
foo.fits[circle(10,10,3),pi=1:5]
and
foo.fits[pi=1:5,circle(10,10,3)]
both are equivalent to:
foo.fits[circle(10,10,3) && pi=1:5]
[NB: This arbitrary rule replaces the previous arbitrary rule (pre-funtools 1.2.3) which stated:
o if the 2nd expression contains a region, the operator used is or.
o if the 2nd expression does not contain a region, the operator used is and.
In that scenario, the or operator was implied by:
pha==4,circle 5 5 1
while the and operator was implied by
circle 5 5 1,pha==4
Experience showed that this non-commutative treatment of the comma operator was confusing and led to unexpected results.]
The comma rule must be considered provisional: comments and complaints are welcome to help clarify the matter. Better still, we recommend
that the comma operator be avoided in such cases in favor of an explicit boolean operator.
SEE ALSO
See funtools(7) for a list of Funtools help pages
version 1.4.2 January 2, 2008 funcombine(7)