I have a texinfo file containing book records and I want to sort them. An example is shown below.
Records are separated by two blank lines. The sort pattern I want to sort is starting from the beginning of the year declaration and finishing at the beginning of the book title where I use the command @strong.
The resulting file would look the same as the original, but the records will be sorted.
Have tried using awk with a space for RS to distinguish each paragraph. However
the result is all messed up.
Last edited by rbatte1; 12-05-2019 at 09:36 AM..
Reason: Tidied away needless newlines and added ICODE tag.
I have a flat file and need to count no of records in the file less the header and the trailer record.
I would appreciate any and all asistance
Thanks
Hadi Lalani (2 Replies)
Hi,
As part of migrating a script from SunOS to MP RAS, the following script is not functioning in desired way.
sort -t\| -u +6 -7 +12 -14 textfile1.out > \
textfile2uniq.out
The -u is fetching unique records differently on SunOS and MP RAS Pentium IV. And thus the records... (1 Reply)
Hi All,
I have two files say file1 and file2.
I want to check the number of records in file1 and if its atleast 2 (i.e., 2 or greater than 2 ) then I have to check records in file2 .If records in file2 is atleast 1 (i.e. if its not empty ) i have to set some conditions .
Could you pls... (3 Replies)
Hi all,
I am using this command "sort -d -u -k1 IMSTEST.74E -o tmp.txt" to the records in the flat.
Can any tell me how to sort the file except first line in the file
For ex:
i/p
First line: DXYZ
Second line : jumy
third : cmhk
fourth : andy
Output should... (5 Replies)
hi,
Please suggest me how to do this logic
say i am dynamically taking a file name into the script.
when ever a file name it should sort the all the records based on the first character in every line except the heading line and ending line.
for example
file1
heading... (1 Reply)
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
I have 2 files
"File 1" is delimited by ";" and "File 2" is delimited by "|".
File 1 below (3 record shown):
Doc1;03/01/2012;New York;6 Main Street;Mr. Smith 1;Mr. Jones
Doc2;03/01/2012;Syracuse;876 Broadway;John Davis;Barbara Lull
Doc3;03/01/2012;Buffalo;779 Old Windy Road;Charles... (2 Replies)
Hi I am new to shell programming in unix
Please if I can provide help.
I have a file structure of a header record and "N" detail records.
The header record will be the total number of detail records
I need to split the file in 2:
One for the header
Another for all detail records
Could... (1 Reply)
Hi Everyone,
I have below record set. File is fixed widht file
101newjersyus 20150110
101nboston us 20150103
102boston us 20140106
102boston us 20140103
I need to group record based on first 3 letters in our case(101 and 102)
and sort last 8 digit in ascending order and print only... (4 Replies)