Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
When we covered Test Parsing in the Intermediate tutorial we simply extracted a first and last name from a single field using Left Words, Right Words and Middle Words functions. This was to correct an import issue where we had a first and last name imported into a single field. We also used a slightly more complex technique to parse the City, State and Zip using the Position function. Both of these techniques are pretty standard text parsing routines. However, there are many more text parsing formulas which we can even use to create features and that's what we're going to do here. We're going to demonstrate how to save Find criteria, which is different than storing the serial numbers. We're going to use Text Parsing to create an actual feature. By saving the Find Criteria, the Save Set can actually evolve as records are added and modified. If we just save the serial numbers we're just saving a record of that record and it could change the Find Criteria, it might not meet it anymore and it'll still find it. But both methods do have merit depending on the scenario. Sometimes you choose one, sometimes you choose other, it all depends on what you want. You have to compare and contrast them. We're also going to show you how to parse an E-mail dynamically, how to parse a pop-up menu and how to parse new requests in a Find. But before we do all this, we need to go over the basics of Text Parsing beyond the Word functions, so we're going to open up the Data Viewer and take a look at all these examples and some of this is review so, we're just trying to set a tone for this whole section here. So you probably already understand the Left function, it's pretty simple. I said get the first four characters of this First Name field in this record, which gives me John over here, so that's pretty simple. Now it doesn't really work when you go to another record, right. It does on this one, this happens to be a four-letter first name, but we go to Billy and it only gets Bill. So it doesn't quite work there. On the other hand, Left Words works great in all situations. It allows you to get the first word in all situations. The only issue is you have to understand the algorithm, where a word begins and ends and the space is the most common, but commas and periods and hyphens and all kinds of things, returns, all these things can be considered word separators and you have to really understand that algorithm so it doesn't control you. You want to control it and in some situations it may not work with your data. So you have to be able to have these other methods of extracting data other than Left and Left Words and this brings up our next example. This example we used the basic idea when we're parsing the City, State and Zip in the Intermediate tutorial. It uses the Left function and the Position function and you can see that it does the same thing as the Word functions in this case, we get John here. It looks for the space and grabs just John and that works great, although it doesn't quite work in all situations. You can see on Aida it doesn't recognize what the end of this field is, you know, there's no space to find so it comes up with nothing. So there's a little bit of a problem here but that's not what we're looking for, we're looking for the advantages of this technique but of course you should always look at the advantages and disadvantages, but right now we're going to concentrate on the advantages. So let's take a look, a closer look at this formula and you can see it uses the Left function on the outside but instead of putting the number here it dynamically generates this value here. It does it with the Position function which says look at the First Name field, look for a space, start at the first character, in this case the J in John and look for the first occurrence of this character, the space. There could be multiple spaces, look for the first one. That will return a 5. So if we hit 5 here we'll see that that results down. It first works on the Position function, gives us a 5. And then we know we don't want 5 because we don't want John space we want just John, so we subtract 1 so it ultimately comes down to 4, which is really the same thing as what we have up here, it's just dynamically generating that second parameter of the Left function. What's the big advantage? Well, here it is. You get to control the algorithm. You get to choose what it searches for. We chose a space here but you can choose anything you want. You can look for a comma, you can look for a whole string if you want. You have control over it and you can decide to focus it in on what you want to find. Let's take a look at some more examples. Here's a Right function. It says, look at the first name and grab the right four characters, no problem. Now the Right Words only as specified 1 get the Right word, does the same thing here, works great. It knows from the right to go over till it finds a word break. Here's how we do it with this Position function and the Right function. Now it's a little more complicated because the Right function starts from the right side and the Left function, or the Position function, starts from the left side as well as, you know, most functions. Most functions start from the left side. There's only a few like Right and Right Words that actually begin from the right, so when you're working with other functions you have to do some more complicated stuff to make it work the way you want it to. So, it looks at the First Name field then does the same thing as it did with the other technique, it finds that space, starting from the left side and then subtracts out of the length, the whole length of that name, this and that gives us how much we want to go from the right side. So it's a little more complicated and sometimes it even gets more complicated than what we see here in order to make it work. You know, we have a fairly simple example but the idea here is that you probably want to memorize these two things. I don't usually recommend memorizing things, but these two formulas here are so crucial. They're the building blocks of any parsing routine that's more complicated than just Left Words or Right Words. I would recommend memorizing them, even though I generally don't recommend that because memorizing stuff is not as important as really understanding it, but these I've memorized so you can write them down, but not just write them down but also be able to modify them without having to look at them and understand them again. When you memorize them you probably understand them well and can write them and then you can make variations on them, as we're going to do as we go all through all these sections. We're going to do variations on these basic building blocks.
| Course: | FileMaker Pro 11: Advanced |
| Author: | John Mark Osborne |
| SKU: | 34140 |
| ISBN: | 1-936334-36-4 |
| Release Date: | 2010-07-09 |
| Duration: | 14.5 hrs / 159 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |