hi
im completely new at unix so dont hate me for asking what is probably the easiest question ever.
below is an extract of some data im processing. the first column is like a counter while the second is an ip address. i need to be able to output the ip address based on which has the largest... (4 Replies)
this works:
cat file.txt| awk 'NR==45,NR==55'
but how do I assign variables instead of numbers:
this does not work:
cat file.txt | awk 'NR==$start,NR==$end'
there need variables instead of numbers
Sorry for my English
Thank you for answer (3 Replies)
Hi all
I have file with columns
F3 pathway CPS
F2
H2
H4
H5
H6 no pathway CMP
H7
H8
H9
H10
My expected output is
F3 pathway CPS
F2 pathway CPS (10 Replies)
I have a spreadsheet of extremely long rows of numbers. I want to print only the last column. Tried using printf but there seems to be too many rows.
example:
3 100 34 7 23 0 8 ..... X
400 203 778 1 ..........Y
58 3 9 0 100 ..........Z
I only want to print X, Y and... (1 Reply)
I have this in a file
11.22.33.44
yyyyyyuser
With awk/sed, I need this to be output as follows
alias server.domain.com='ssh yyyyyyuser@11.22.33.44' (4 Replies)
Hi.
How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg
file1
1:abc
3:ghi
6:pqr
file2
a abc
b def
c ghi
d jkl
e mno
f pqr
... (6 Replies)
Hi. How can I read row number from one file and print that corresponding record present at that row in another file.
eg
file1
1
3
5
7
9
file2
11111
22222
33333
44444
55555
66666
77777
88888
99999 (3 Replies)
this is the requirement
list.txt
table1
table2
table3
testfile.txt
name#place#data#select * from table1
name2#place2#data2#select * from table 10 innerjoin table3
name2#place2#data2#select * from table 10
output
name place table1
name2 place table3
i tried using awk (7 Replies)
sortbib(1) General Commands Manual sortbib(1)Name
sortbib - sort bibliographic database
Syntax
sortbib [-sKEYS] database...
Description
The command sorts files of records containing refer key-letters by user-specified keys. Records may be separated by blank lines, or by .[
and .] delimiters, but the two styles may not be mixed together. This program reads through each database and pulls out key fields, which
are sorted separately. The sorted key fields contain the file pointer, byte offset, and length of corresponding records. These records
are delivered using disk seeks and reads, so may not be used in a pipeline to read standard input.
By default, alphabetizes by the first %A and the %D fields, which contain the senior author and date. The -s option is used to specify new
KEYS. For instance, -sATD will sort by author, title, and date, while -sA+D will sort by all authors, and date. Sort keys past the fourth
are not meaningful. No more than 16 databases may be sorted together at one time. Records longer than 4096 characters will be truncated.
The command sorts on the last word on the %A line, which is assumed to be the author's last name. A word in the final position, such as
``jr.'' or ``ed.'', will be ignored if the name beforehand ends with a comma. Authors with two-word last names or unusual constructions
can be sorted correctly by using the convention `` '' in place of a blank. A %Q field is considered to be the same as %A, except sorting
begins with the first, not the last, word. The command sorts on the last word of the %D line, usually the year. It also ignores leading
articles (like ``A'' or ``The'') when sorting by titles in the %T or %J fields; it will ignore articles of any modern European language.
If a sort-significant field is absent from a record, places that record before other records containing that field.
Options-sKEYS
Specifies new sort KEYS. For example, ATD sorts by author, title, and date.
See Alsoaddbib(1), indxbib(1), lookbib(1), refer(1), roffbib(1)sortbib(1)