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!

Complicated Sort, don't know how?

Status
Not open for further replies.

wolves

Programmer
Jan 26, 2001
130
US
Here is the objective. To sort the input file, and make sure the data is in correct order.

Example

INPUT DATA:


AGABTI PAPER
ABABTI SUPPLY
ABABTI PAPER
AGABTI SUPPLY
AGABTI PAPERS
ABABTI SUPPLYS
ABABTI PAPERS
AGABTI SUPPLYS


I need to sort it by the first 2 letters in field one, then field 2,
so the output should look like this:



ABABTI PAPER
AGABTI PAPER
ABABTI PAPERS
AGABTI PAPERS
ABABTI SUPPLY
AGABTI SUPPLY
ABABTI SUPPLYS
AGABTI SUPPLYS


I don't have full code yet, but I ran a small code test to sort field 1(1:2) and field 2, I only get



ABABTI PAPER
ABABTI PAPERS
ABABTI SUPPLY
ABABTI SUPPLYS
AGABTI PAPER
AGABTI PAPERS
AGABTI SUPPLY
AGABTI SUPPLYS





 
Your expected result is sorted by field 2 then field 1.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
boy that was dumb on my part.
Thx for helping a beginner.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top