bug report for sort command

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
MarkLawrence
Posts: 9
Joined: Wed Feb 04, 2009 5:58 am

bug report for sort command

Post by MarkLawrence »

Below is a file which does not get sorted correctly.

the sort parameters are <C1 L6> <C49 L4> <C17 L24>, all ascending, all case sensitive.

Sample data: (includes tabs)

Code: Select all

APRILIA		750 Shiver			 750cc	2009	57035
APRILIA		750 Shiver			 750cc	2008	57035
APRILIA		750 Shiver			 750cc	2012	57035
APRILIA		750 Shiver			 750cc	2011	57035
APRILIA		750 Shiver			 750cc	2010	57035
APRILIA		Dorsoduro 750			 750cc	2009	57035
APRILIA		Dorsoduro 750			 750cc	2010	57035
APRILIA		Dorsoduro 750			 750cc	2011	57035
APRILIA		Dorsoduro 750			 750cc	2012	57035
APRILIA		850 Mana GT			 850cc	2011	57035
APRILIA		850 Mana GT			 850cc	2012	57035
APRILIA		850 Mana GT			 850cc	2010	57035
APRILIA		850 Mana			 850cc	2010	57035
APRILIA		850 Mana			 850cc	2009	57035
APRILIA		850 Mana			 850cc	2008	57035
APRILIA		850 Mana			 850cc	2011	57035
APRILIA		850 Mana			 850cc	2012	57035
APRILIA		RSV4 R Factory			1000cc	2011	51359
APRILIA		RSV4 R Factory			1000cc	2009	51359
APRILIA		RSV4 R Factory			1000cc	2010	51359
APRILIA		RSV4 R Factory			1000cc	2012	51359
APRILIA		RSV4 R				1000cc	2012	51359
APRILIA		RSV4 R				1000cc	2010	51359
APRILIA		RSV4 R				1000cc	2009	51359
APRILIA		RSV4 R				1000cc	2011	51359
APRILIA		Dorsoduro 1200			1200cc	2011	57035
APRILIA		Dorsoduro 1200			1200cc	2012	57035
BMW		G450X				 450cc	2012	57936
BMW		G450X				 450cc	2011	57936
BMW		G450X				 450cc	2009	57936
BMW		G450X				 450cc	2010	57936
BMW		G450X				 450cc	2008	57936
BMW		R45				 450cc	1969	24945
BMW		R45				 450cc	1971	24945
BMW		R45				 450cc	1972	24945
BMW		R45				 450cc	1970	24945
BMW		R560/5				 500cc	1971	24945
BMW		R560/5				 500cc	1970	24945
BMW		R560/5				 500cc	1969	24945
BMW		R560/5				 500cc	1972	24945
BMW		R60				 600cc	1975	24945
BMW		R60				 600cc	1976	24945
BMW		R60				 600cc	1979	24945
BMW		R60				 600cc	1982	24945
BMW		R60				 600cc	1984	24945
BMW		R60				 600cc	1977	24945
BMW		R60				 600cc	1970	24945
BMW		R60				 600cc	1981	24945
BMW		R60				 600cc	1980	24945
BMW		R60				 600cc	1969	24945
BMW		R60				 600cc	1974	24945
BMW		R60				 600cc	1973	24945
BMW		R60				 600cc	1972	24945
BMW		R60				 600cc	1971	24945
BMW		R60				 600cc	1978	24945
BMW		R65				 650cc	1984	24945
BMW		R65				 650cc	1985	24945
BMW		R65				 650cc	1986	24945
BMW		R65				 650cc	1987	24945
BMW		R65				 650cc	1982	24945
BMW		R65				 650cc	1978	24945
BMW		R65				 650cc	1979	24945
BMW		R65				 650cc	1980	24945
BMW		R65				 650cc	1981	24945
BMW		R65				 650cc	1983	24945
BMW		R65				 650cc	1988	24945
BMW		R65LS				 650cc	1984	24945
BMW		R65LS				 650cc	1978	24945
BMW		R65LS				 650cc	1983	24945
BMW		R65LS				 650cc	1979	24945
BMW		R65LS				 650cc	1980	24945
BMW		R65LS				 650cc	1981	24945
BMW		R65LS				 650cc	1982	24945
BMW		R75				 750cc	1973	24945
BMW		R75				 750cc	1972	24945
BMW		R75				 750cc	1971	24945
BMW		R75				 750cc	1970	24945
BMW		R75				 750cc	1969	24945
BMW		R75				 750cc	1975	24945
BMW		R75				 750cc	1974	24945
BMW		R75				 750cc	1984	24945
BMW		R75				 750cc	1983	24945
BMW		R75				 750cc	1982	24945
BMW		R75				 750cc	1981	24945
BMW		R75				 750cc	1980	24945
BMW		R75				 750cc	1977	24945
BMW		R75				 750cc	1976	24945
BMW		R75				 750cc	1979	24945
BMW		R75				 750cc	1978	24945
BMW		F800GS				 800cc	2009	57936
BMW		F800GS				 800cc	2011	57936
BMW		F800GS				 800cc	2010	57936
BMW		F800GS				 800cc	2012	57936
BMW		F800R				 800cc	2009	57936
BMW		F800R				 800cc	2010	57936
BMW		F800R				 800cc	2012	57936
BMW		F800R				 800cc	2011	57936
BMW		F800S				 800cc	2011	57936
BMW		F800S				 800cc	2012	57936
BMW		F800S				 800cc	2006	57936
BMW		F800S				 800cc	2007	57936
BMW		F800S				 800cc	2010	57936
BMW		F800S				 800cc	2008	57936
BMW		F800S				 800cc	2009	57936
BMW		F800ST				 800cc	2006	57936
BMW		F800ST				 800cc	2008	57936
BMW		F800ST				 800cc	2011	57936
BMW		F800ST				 800cc	2010	57936
BMW		F800ST				 800cc	2007	57936
BMW		F800ST				 800cc	2012	57936
BMW		F800ST				 800cc	2009	57936
BMW		R80 GS eng. w/o Oil Cooler	 800cc	1988	24945
BMW		R80 GS eng. w/o Oil Cooler	 800cc	1987	24945
BMW		R80 GS eng. w/o Oil Cooler	 800cc	1990	24945
BMW		R80 GS eng. w/o Oil Cooler	 800cc	1989	24945
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

That is not a helpful problem report.

Where are the tabs? In what sense do the records "not get sorted correctly"?
MarkLawrence
Posts: 9
Joined: Wed Feb 04, 2009 5:58 am

Post by MarkLawrence »

Here's the same data, \t -> \$

The sort command above should put these into ascending order by year. It doesn't. I am getting the sort by manufacturer, sub sort by cc's, then sub-sub sort by model name, but the year is random.

We sort on (1 manufacturer) (2 engine displacement) (3 model name, but this field extends through the engine displacement and into the model year)

I have not changed the default setting for tabs, which I expect is every 8 characters.

The original file is 7377 lines long. This is a small subset. I'll be happy to email you the original if you like.

Code: Select all

APRILIA$$750 Shiver$$$ 750cc$2010$57035
APRILIA$$750 Shiver$$$ 750cc$2009$57035
APRILIA$$750 Shiver$$$ 750cc$2008$57035
APRILIA$$750 Shiver$$$ 750cc$2012$57035
APRILIA$$750 Shiver$$$ 750cc$2011$57035
APRILIA$$Dorsoduro 750$$$ 750cc$2009$57035
APRILIA$$Dorsoduro 750$$$ 750cc$2010$57035
APRILIA$$Dorsoduro 750$$$ 750cc$2011$57035
APRILIA$$Dorsoduro 750$$$ 750cc$2012$57035
APRILIA$$850 Mana GT$$$ 850cc$2010$57035
APRILIA$$850 Mana GT$$$ 850cc$2011$57035
APRILIA$$850 Mana GT$$$ 850cc$2012$57035
APRILIA$$850 Mana$$$ 850cc$2010$57035
APRILIA$$850 Mana$$$ 850cc$2009$57035
APRILIA$$850 Mana$$$ 850cc$2008$57035
APRILIA$$850 Mana$$$ 850cc$2011$57035
APRILIA$$850 Mana$$$ 850cc$2012$57035
APRILIA$$RSV4 R Factory$$$1000cc$2012$51359
APRILIA$$RSV4 R Factory$$$1000cc$2011$51359
APRILIA$$RSV4 R Factory$$$1000cc$2009$51359
APRILIA$$RSV4 R Factory$$$1000cc$2010$51359
APRILIA$$RSV4 R$$$$1000cc$2012$51359
APRILIA$$RSV4 R$$$$1000cc$2010$51359
APRILIA$$RSV4 R$$$$1000cc$2009$51359
APRILIA$$RSV4 R$$$$1000cc$2011$51359
APRILIA$$Dorsoduro 1200$$$1200cc$2012$57035
APRILIA$$Dorsoduro 1200$$$1200cc$2011$57035
BMW$$G450X$$$$ 450cc$2012$57936
BMW$$G450X$$$$ 450cc$2011$57936
BMW$$G450X$$$$ 450cc$2009$57936
BMW$$G450X$$$$ 450cc$2010$57936
BMW$$G450X$$$$ 450cc$2008$57936
BMW$$R45$$$$ 450cc$1970$24945
BMW$$R45$$$$ 450cc$1969$24945
BMW$$R45$$$$ 450cc$1971$24945
BMW$$R45$$$$ 450cc$1972$24945
BMW$$R560/5$$$$ 500cc$1972$24945
BMW$$R560/5$$$$ 500cc$1971$24945
BMW$$R560/5$$$$ 500cc$1970$24945
BMW$$R560/5$$$$ 500cc$1969$24945
BMW$$R60$$$$ 600cc$1975$24945
BMW$$R60$$$$ 600cc$1976$24945
BMW$$R60$$$$ 600cc$1979$24945
BMW$$R60$$$$ 600cc$1982$24945
BMW$$R60$$$$ 600cc$1984$24945
BMW$$R60$$$$ 600cc$1977$24945
BMW$$R60$$$$ 600cc$1970$24945
BMW$$R60$$$$ 600cc$1981$24945
BMW$$R60$$$$ 600cc$1980$24945
BMW$$R60$$$$ 600cc$1969$24945
BMW$$R60$$$$ 600cc$1974$24945
BMW$$R60$$$$ 600cc$1973$24945
BMW$$R60$$$$ 600cc$1972$24945
BMW$$R60$$$$ 600cc$1971$24945
BMW$$R60$$$$ 600cc$1978$24945
BMW$$R65$$$$ 650cc$1984$24945
BMW$$R65$$$$ 650cc$1985$24945
BMW$$R65$$$$ 650cc$1986$24945
BMW$$R65$$$$ 650cc$1987$24945
BMW$$R65$$$$ 650cc$1982$24945
BMW$$R65$$$$ 650cc$1978$24945
BMW$$R65$$$$ 650cc$1979$24945
BMW$$R65$$$$ 650cc$1980$24945
BMW$$R65$$$$ 650cc$1981$24945
BMW$$R65$$$$ 650cc$1983$24945
BMW$$R65$$$$ 650cc$1988$24945
BMW$$R65LS$$$$ 650cc$1982$24945
BMW$$R65LS$$$$ 650cc$1984$24945
BMW$$R65LS$$$$ 650cc$1978$24945
BMW$$R65LS$$$$ 650cc$1983$24945
BMW$$R65LS$$$$ 650cc$1979$24945
BMW$$R65LS$$$$ 650cc$1980$24945
BMW$$R65LS$$$$ 650cc$1981$24945
BMW$$R75$$$$ 750cc$1973$24945
BMW$$R75$$$$ 750cc$1972$24945
BMW$$R75$$$$ 750cc$1971$24945
BMW$$R75$$$$ 750cc$1970$24945
BMW$$R75$$$$ 750cc$1969$24945
BMW$$R75$$$$ 750cc$1975$24945
BMW$$R75$$$$ 750cc$1974$24945
BMW$$R75$$$$ 750cc$1984$24945
BMW$$R75$$$$ 750cc$1983$24945
BMW$$R75$$$$ 750cc$1982$24945
BMW$$R75$$$$ 750cc$1981$24945
BMW$$R75$$$$ 750cc$1980$24945
BMW$$R75$$$$ 750cc$1977$24945
BMW$$R75$$$$ 750cc$1976$24945
BMW$$R75$$$$ 750cc$1979$24945
BMW$$R75$$$$ 750cc$1978$24945
BMW$$F800GS$$$$ 800cc$2009$57936
BMW$$F800GS$$$$ 800cc$2011$57936
BMW$$F800GS$$$$ 800cc$2010$57936
BMW$$F800GS$$$$ 800cc$2012$57936
BMW$$F800R$$$$ 800cc$2011$57936
BMW$$F800R$$$$ 800cc$2009$57936
BMW$$F800R$$$$ 800cc$2010$57936
BMW$$F800R$$$$ 800cc$2012$57936
BMW$$F800S$$$$ 800cc$2011$57936
BMW$$F800S$$$$ 800cc$2012$57936
BMW$$F800S$$$$ 800cc$2006$57936
BMW$$F800S$$$$ 800cc$2007$57936
BMW$$F800S$$$$ 800cc$2010$57936
BMW$$F800S$$$$ 800cc$2008$57936
BMW$$F800S$$$$ 800cc$2009$57936
BMW$$F800ST$$$$ 800cc$2006$57936
BMW$$F800ST$$$$ 800cc$2008$57936
BMW$$F800ST$$$$ 800cc$2011$57936
BMW$$F800ST$$$$ 800cc$2010$57936
BMW$$F800ST$$$$ 800cc$2007$57936
BMW$$F800ST$$$$ 800cc$2012$57936
BMW$$F800ST$$$$ 800cc$2009$57936
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You haven't included the year in your sort keys.

Have you tried
  From:  1   Length: 6
  From: 49   Length: 4
  From: 17   Length:
(without limiting the length of the third key)?
MarkLawrence
Posts: 9
Joined: Wed Feb 04, 2009 5:58 am

Post by MarkLawrence »

Thanks, that worked. I was trusting the column count at the bottom of the textpad window; it reported 24 columns was enough. You're right, it took 45 columns to include the year.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

The count in the status bar doesn't claim to be of columns, and it isn't: it's of bytes selected. (Characters and bytes are the same thing in TextPad.) And a tab is a single character. The sorting is by column position.

Not a bug, then.
Post Reply