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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix: Sorting file based on bytes 1

Status
Not open for further replies.

bigbalbossa

Programmer
Mar 21, 2002
87
0
0
US
What syntax can be used if I want to sort a 900 byte fixed length file on bytes 40 - 60 (may or may not be numeric)?

I'd like to develop a perl script with an option to allow users to specify a sort range.

Thanks
 
Straight from my man sort pages:
To sort a file based on columns, use the -t option to specify a field separator character which does not appear in the input. This will cause each line to be treated as a single field. The -k option or the +pos1 and -pos2 specifiers can then be used to sort on particular ranges of columns.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Wow...funny i missed that in the man pages. Thanks PHV!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top