Re: Sorting Question for Marshall Barton (Cont'd)
- From: Tom <tom@xxxxxxxx>
- Date: Wed, 05 Sep 2007 17:47:22 -0400
Marsh,
I tried to do a better explanation based on your last message, but
apparently did not succeed. I probably just don't know how to put my ideas
into the correct programming terms or rules.
I am also confused on how to deal with and make one rule for strings that
begin with numbers and strings that begin with characters. I am thinking
we have to look at both major types of strings, but could be wrong.
I deal with two major types of part number strings:
One type is either all digits from 1 to 12 digits, or it is 1 to 12 digits
with non-numeric characters in the string and may have non-numeric
characters at the end.
So, in this case would you check to see if there is any non-numeric
characters. If not, pad to 8 digits and sort. This would take care of
pure numeric strings. If the string has non-numeric characters in the
string, go to the first non-numeric character, and pad the left to cover
say 5 digits? You could then allow for 8 digits in the middle after the
left non-numeric character and sort. The right would be any non-numeric
character after the numeric string in the middle.
The other string type begins with from one to four alpha characters, can
have as many as 8 digits following the characters, and may have some
non-numeric characters at the end.
So, in this case the left would be up to 4 characters, the middle would be
up to eight numeric digits, and the right would be any non-numeric
character to the right of the mid?
Again, my terminology probably leaves a lot to be desired.
Does this make any sense?
Thanks
Tom
On Wed, 05 Sep 2007 12:14:41 -0500, Marshall Barton
<marshbarton@xxxxxxxxxx> wrote:
I think your first rule is inconsistent/ambiguous.--
How can you determine the difference between the left,
middle and right portions of a part number like 1X2? It
seems to me that it could be either
L M R
1X 2
or
1 X2
You need to specify a set of rules that can be used to
separate the left, middle and right portions for every
possible part number. Without more definitive rules, I
don't see how we can write code to figure it out for you.
The fundamental concept that I was suggesting is to first
separate the portions (using code that implements your
rules) and then put them back together in a canonical form
that will sort the way you want.
Tom
.
- Follow-Ups:
- Re: Sorting Question for Marshall Barton (Cont'd)
- From: Marshall Barton
- Re: Sorting Question for Marshall Barton (Cont'd)
- References:
- Sorting Question for Marshall Barton (Cont'd)
- From: Tom
- Re: Sorting Question for Marshall Barton (Cont'd)
- From: Marshall Barton
- Sorting Question for Marshall Barton (Cont'd)
- Prev by Date: Re: Sorting and Grouping not working
- Next by Date: Re: Sorting and Grouping not working
- Previous by thread: Re: Sorting Question for Marshall Barton (Cont'd)
- Next by thread: Re: Sorting Question for Marshall Barton (Cont'd)
- Index(es):
Relevant Pages
|