You're seeing the last line come out at top because you're not closing the pipe to the sort command and thus your print is happening before sort finishes and prints it's output. Here's my solution, which also doesn't require knowing the number of records between before hand:
I have i got a requirement like below.
I have input file which contains following fixed width records.
00000000000088500232007112007111
I need the full record and concatenated with ~ and characters from 1to 5 and concatenated with ~ and charactes from 10 to 15
The out put will be like... (1 Reply)
Hi @ all
I'm trying to achive to this problem,
I've a 2-column composed file as the following:
192.168.1.2 2
192.168.1.3 12
192.168.1.2 4
192.168.1.4 3
cpc1-swan1-2-3-cust123.swan.cable.ntl.com 4
192.168.1.3 5
192.168.1.2 10
192.168.1.4 8... (8 Replies)
How do I use awk to find the records in a file that contains two specific strings?
I have tried piping and using awk two times, but I don't know how to do it in one action. (2 Replies)
Hi,
i want to generate print statement using awk.
i have 20+ and 30+ fields in each line
Now its priting only first eight fields print statement as output not all.
my record is as shown below filename
... (2 Replies)
I have an initial record 0.018
I would like a script that would for i=0;i<200;i++ print
0.018*1
0.018*2
0.018*3
0.018*4
...
0.018*200
using newline. (7 Replies)
Hi! all
can any one tell me how to compare current record of column with next and previous record in awk without using array
my case is like this
input.txt
0 32
1 26
2 27
3 34
4 26
5 25
6 24
9 23
0 32
1 28
2 15
3 26
4 24 (7 Replies)
how to use "awk" to print any record has pattern not equal ? for example my file has 5 records & I need to get all lines which $1=10 or 20 , $2=10 or 20 and $3 greater than "130302" as it shown :
10 20 1303252348212B030
20 10 1303242348212B030
40 34 1303252348212B030
10 20 ... (14 Replies)
Hi all , I have two files : dblp.xml with dblp records and itu1.txt with faculty members records. I need to find out how many dblp records are related to the faculty members. More specific: I need to find out which names from itu1.txt are a match in dblp. xml file , print them and show how many... (4 Replies)