Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting using the 1635-1647th positions

Status
Not open for further replies.

lmikule

Programmer
Mar 13, 2001
1
US
Looking for a way to sort a file on the 1635-1647th postion of the records. Looking at the Unix sort command it seems as though you have to have some kind of field delimiter. There are no delimiters in this file. Started browsing the AWK forum to see if anything might already have been posted, but didn't find anything. Any help would be greatly appreciated!
 
lmikule-

Try something like this:

awk 'BEGIN{FS=""} # sets field separator to none

{
NR==1

if (( NR > 1634 ) && ( NR < 1648 )) print

}' your_file | sort > output_file

Hope this helps




flogrr
flogr@yahoo.com

 
Try this.
When # is a char never used in your file so
every line is one record.

sort -t# -b -k 1.1635,1.1647

I never tried it on lines that long.

succes Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top