![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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) |
#3
| |||
| |||
|
|
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) |
#4
| |||
| |||
|
|
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) |
#5
| |||
| |||
|
|
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. |
)![]() |
| Thread Tools | |
| Display Modes | |
| |