![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have the following return-separated values (they are file names) in a field: HOME.QDF HOME.QEL HOME.QPH HOME.QSD Q3.DIR Using MiddleWords ( Field ; Num ; 1 ) I can parse a value from the list, depending on the value of Num. I'm using MiddleWords instead of MiddleValues so as to get just the file name in the parsed value, without the line-end return. When Num = 1 through 4, I get the entire file name: "Home.***". When Num = 5, all I get is "Q3". The file extension (including the dot) is not picked up. Turns out that the MiddleWords function is treating Q3 and DIR as separate words. It makes no difference what line "Q3.DIR" is on. It would appear that there is something about "DIR" that the function doesn't like. Help says nada. Any thoughts? Matt |
#3
| |||
| |||
|
|
I have the following return-separated values (they are file names) in a field: HOME.QDF HOME.QEL HOME.QPH HOME.QSD Q3.DIR Using MiddleWords ( Field ; Num ; 1 ) I can parse a value from the list, depending on the value of Num. I'm using MiddleWords instead of MiddleValues so as to get just the file name in the parsed value, without the line-end return. When Num = 1 through 4, I get the entire file name: "Home.***". When Num = 5, all I get is "Q3". The file extension (including the dot) is not picked up. Turns out that the MiddleWords function is treating Q3 and DIR as separate words. It makes no difference what line "Q3.DIR" is on. It would appear that there is something about "DIR" that the function doesn't like. Help says nada. Any thoughts? Matt Addendum: In Help, entries for LeftWords, MiddleWords and RightWords say that & and - (ampersand and hyphen) mark the beginning of a new word. Hmmm. The examples all use words that are separated by spaces. Seems line end works too, but nothing is said about . (period/dot). Oh, by the way, FMD7/WXP. Matt -- |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
You may try to add to YrField a 'return' at the end, ie YrField2 = YrField & "P" ("P" is the 'return'), and work on YrField2. You may also try to use first 'Middle' to replace the "." (dot) by a space or something ("$$" ?) in YrField2, then parse and replace back your "$$" by dots. Etc. Remi-Noel "Matt Wills" <Im (AT) Witz (DOT) End> a icrit : I have the following return-separated values (they are file names) in a field: HOME.QDF HOME.QEL HOME.QPH HOME.QSD Q3.DIR Using MiddleWords ( Field ; Num ; 1 ) I can parse a value from the list, depending on the value of Num. I'm using MiddleWords instead of MiddleValues so as to get just the file name in the parsed value, without the line-end return. When Num = 1 through 4, I get the entire file name: "Home.***". When Num = 5, all I get is "Q3". The file extension (including the dot) is not picked up. Turns out that the MiddleWords function is treating Q3 and DIR as separate words. It makes no difference what line "Q3.DIR" is on. It would appear that there is something about "DIR" that the function doesn't like. Help says nada. Any thoughts? Matt Addendum: In Help, entries for LeftWords, MiddleWords and RightWords say that & and - (ampersand and hyphen) mark the beginning of a new word. Hmmm. The examples all use words that are separated by spaces. Seems line end works too, but nothing is said about . (period/dot). Oh, by the way, FMD7/WXP. Matt -- |
#6
| |||
| |||
|
|
The problem is the "3.". As a quick test I have done a WordCount on Home.QDF and Home1.qdf. In the first case the result is 1 and in the second case the result is 2. On the other hand Ho1me.qdf returns 1 but Ho1.me.qdf returns 2. Replace these periods by commas and the count rises to 3. I don't know if this is covered in the help, I couldn't find it. But for some reason periods and commas are treated differently in counting words and preceding a period by a digit seems to mark the end of a word. |
|
You may try to add to YrField a 'return' at the end, ie YrField2 = YrField & "P" ("P" is the 'return'), and work on YrField2. You may also try to use first 'Middle' to replace the "." (dot) by a space or something ("$$" ?) in YrField2, then parse and replace back your "$$" by dots. Etc. Remi-Noel |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
There is an assumption built into this that a filename will never contain two words and in particular no spaces or more than one period, if that can be guaranteed then you will have no problem. |
|
Going back to your first post I would have thought the simpext solution would be to use MiddleValues and remove the final carriage return - I think that all FMP functions which return a Value always return with a final carriage return. So the filenames are obtained by Left(MiddleValues(Field;num;1);Length(MiddleValues (Field;num;1)) - 1) |
![]() |
| Thread Tools | |
| Display Modes | |
| |