dbTalk Databases Forums  

Separate Numbers

comp.databases.filemaker comp.databases.filemaker


Discuss Separate Numbers in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
big foot
 
Posts: n/a

Default Separate Numbers - 07-19-2005 , 06:56 PM






Using FMPro 6.0 on WinXp.

I am trying to separate the below samples of data into three fields. These
sequence of numbers always appear at the beginning of a text field (all)
that contains additional information. The sequence of numbers always have a
I can use a script or calc. field.



all
field1 field2 field3
100.600.2? other text of various types 100 600
2
1200.1100.3? other text of various types 1200 1100
3
1200.100.1? other text of various types 1200 100
1
100.1200.12? other text of various types 100 1200
12

Field1 and Field2 calculations appear to work OK. I can't get Field3 to
work properly. Am I approaching this problem correctly?
I have worked with the Field3 calculation so much I probably have it very
hosed up.

Field1 = Left( Left( all,Position(all, ".", 1,1 ) ), Length(Left(
all,Position(all, ".", 1,1 ) -1) ))
Field2 = Middle( all, Length(Left( all,Position(all, ".", 1,1 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -1)
Field3 = Middle( all, Length(Left( all,Position(all, ".", 1,2 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -4)




Reply With Quote
  #2  
Old   
bigfoot
 
Posts: n/a

Default Re: Separate Numbers - 07-19-2005 , 07:17 PM






Posting again, word wrap sure made a mess of it.

Thanks in advance for you help.

Using FMPro 6.0 on WinXp.

I am trying to separate the below samples of data into three fields. The
sequence of numbers always appear at the beginning of a text field (all)
that contains additional information. The sequence of numbers always has a
"?" afterwards. I can use a script or calc. field.


GOT NEED
all
field1 field2 field3
100.600.2? other text of various types 100 600
2
1200.1100.3? other text of various types 1200 1100 3
1200.100.1? other text of various types 1200 100
1
100.1200.12? other text of various types 100 1200 12

Field1 and Field2 calculations appear to work OK. I can't get Field3 to
work properly. Am I approaching this problem correctly?
I have worked with the Field3 calculation so much I probably have it very
hosed up.

Field1 = Left( Left( all,Position(all, ".", 1,1 ) ),
Length(Left(all,Position(all, ".", 1,1 ) -1) ))
Field2 = Middle( all, Length(Left( all,Position(all, ".", 1,1 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -1)
Field3 = Middle( all, Length(Left( all,Position(all, ".", 1,2 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -4)














"big foot" <wj (AT) bell (DOT) net> wrote

Quote:
Using FMPro 6.0 on WinXp.

I am trying to separate the below samples of data into three fields.
These sequence of numbers always appear at the beginning of a text field
(all) that contains additional information. The sequence of numbers
always have a I can use a script or calc. field.



all field1 field2 field3
100.600.2? other text of various types 100 600 2
1200.1100.3? other text of various types 1200 1100 3
1200.100.1? other text of various types 1200 100 1
100.1200.12? other text of various types 100 1200 12

Field1 and Field2 calculations appear to work OK. I can't get Field3 to
work properly. Am I approaching this problem correctly?
I have worked with the Field3 calculation so much I probably have it very
hosed up.

Field1 = Left( Left( all,Position(all, ".", 1,1 ) ), Length(Left(
all,Position(all, ".", 1,1 ) -1) ))
Field2 = Middle( all, Length(Left( all,Position(all, ".", 1,1 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -1)
Field3 = Middle( all, Length(Left( all,Position(all, ".", 1,2 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -4)






Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Separate Numbers - 07-19-2005 , 07:56 PM



In article <cJgDe.6671$Wt3.3788 (AT) bignews3 (DOT) bellsouth.net>, "bigfoot"
<REMOVEemailwwjCAPS (AT) bellsouth (DOT) netWORK> wrote:

Quote:
Posting again, word wrap sure made a mess of it.

Thanks in advance for you help.

Using FMPro 6.0 on WinXp.

I am trying to separate the below samples of data into three fields. The
sequence of numbers always appear at the beginning of a text field (all)
that contains additional information. The sequence of numbers always has a
"?" afterwards. I can use a script or calc. field.


GOT NEED
all field1 field2 field3
100.600.2? other text of various types 100 600 2
1200.1100.3? other text of various types 1200 1100 3
1200.100.1? other text of various types 1200 100 1
100.1200.12? other text of various types 100 1200 12

Field1 and Field2 calculations appear to work OK. I can't get Field3 to
work properly. Am I approaching this problem correctly?
I have worked with the Field3 calculation so much I probably have it very
hosed up.

Field1 = Left( Left( all,Position(all, ".", 1,1 ) ),
Length(Left(all,Position(all, ".", 1,1 ) -1) ))

Field2 = Middle( all, Length(Left( all,Position(all, ".", 1,1 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -1)

Field3 = Middle( all, Length(Left( all,Position(all, ".", 1,2 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -4)

Part of the problem seems to be that Field3 is not looking for the "?"
anywhere in there, but there's also a couple of other funny looking
bits too (eg. the Length function in Field1, the -4 on the end of
Field3).


The first field ends before the first ".", so that's easy - just take
everything from the left before the first ".".
ie.
Field1 = Left(All, Position(All, ".", 1, 1) - 1)


The second number begins after the first "." and ends before the second
".".
ie.
Field2 = Middle(All, Position(All, ".", 1, 1) + 1,
Position(All, ".", 1, 2) - 1 - Position(All, ".", 1, 1))


Similarly, the third number begins after the second "." and ends before
the first "?".
ie.
Field3 = Middle(All, Position(All, ".", 1, 2) + 1,
Position(All, "?", 1, 1) - 1 - Position(All, ".", 1, 2))


This assumes all the numbers are whole (ie. no decimal points). These
Calculation fields could return either Text or Number results, but if
you plan to sort the records by these fields they will HAVE to be
Number results.



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
bigfoot
 
Posts: n/a

Default Re: Separate Numbers - 07-20-2005 , 07:22 PM



None of the calcs worked properly.

After studing your Caculations and a fresh look, I resolved the Field3 issue
using your idea to key off of the ?.

Field3 = Middle( all, Length(Left( all,Position(all, ".", 1,2 ) ))+1 ,
Position(all, "?", 1,1 ) - Position(all, ".", 1,2 ) -1)

Thanks for the help.

Bigfoot





"Helpful Harry" <helpful_harry (AT) nom (DOT) de.plume.com> wrote

Quote:
In article <cJgDe.6671$Wt3.3788 (AT) bignews3 (DOT) bellsouth.net>, "bigfoot"
REMOVEemailwwjCAPS (AT) bellsouth (DOT) netWORK> wrote:

Posting again, word wrap sure made a mess of it.

Thanks in advance for you help.

Using FMPro 6.0 on WinXp.

I am trying to separate the below samples of data into three fields. The
sequence of numbers always appear at the beginning of a text field (all)
that contains additional information. The sequence of numbers always has
a
"?" afterwards. I can use a script or calc. field.


GOT NEED
all field1 field2 field3
100.600.2? other text of various types 100 600 2
1200.1100.3? other text of various types 1200 1100 3
1200.100.1? other text of various types 1200 100 1
100.1200.12? other text of various types 100 1200 12

Field1 and Field2 calculations appear to work OK. I can't get Field3 to
work properly. Am I approaching this problem correctly?
I have worked with the Field3 calculation so much I probably have it very
hosed up.

Field1 = Left( Left( all,Position(all, ".", 1,1 ) ),
Length(Left(all,Position(all, ".", 1,1 ) -1) ))

Field2 = Middle( all, Length(Left( all,Position(all, ".", 1,1 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -1)

Field3 = Middle( all, Length(Left( all,Position(all, ".", 1,2 ) ))+1 ,
Position(all, ".", 1,2 ) - Position(all, ".", 1,1 ) -4)


Part of the problem seems to be that Field3 is not looking for the "?"
anywhere in there, but there's also a couple of other funny looking
bits too (eg. the Length function in Field1, the -4 on the end of
Field3).


The first field ends before the first ".", so that's easy - just take
everything from the left before the first ".".
ie.
Field1 = Left(All, Position(All, ".", 1, 1) - 1)


The second number begins after the first "." and ends before the second
".".
ie.
Field2 = Middle(All, Position(All, ".", 1, 1) + 1,
Position(All, ".", 1, 2) - 1 - Position(All, ".", 1, 1))


Similarly, the third number begins after the second "." and ends before
the first "?".
ie.
Field3 = Middle(All, Position(All, ".", 1, 2) + 1,
Position(All, "?", 1, 1) - 1 - Position(All, ".", 1, 2))


This assumes all the numbers are whole (ie. no decimal points). These
Calculation fields could return either Text or Number results, but if
you plan to sort the records by these fields they will HAVE to be
Number results.



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)



Reply With Quote
  #5  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Separate Numbers - 07-20-2005 , 07:46 PM



In article <RTBDe.11992$xn.6893 (AT) bignews6 (DOT) bellsouth.net>, "bigfoot"
<REMOVEemailwwjCAPS (AT) bellsouth (DOT) netWORK> wrote:

Quote:
None of the calcs worked properly.
Really?!?!? They work fine for all your examples. ?\



Quote:
After studing your Caculations and a fresh look, I resolved the Field3 issue
using your idea to key off of the ?.

Field3 = Middle( all, Length(Left( all,Position(all, ".", 1,2 ) ))+1 ,
Position(all, "?", 1,1 ) - Position(all, ".", 1,2 ) -1)

Thanks for the help.
You shouldn't need the added complication of the Length and Left
functions, but as long as you've got it working and you understand how
it works, that's all that matters. )



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.