March 16, 201411 yr Hello All. I'm using FilemakerPro12 on a single MacMini. I'm using FMPro12 as a single, desktop database, to massage-and-output text; I am the only person who will access the database, no other users, Web users or anything like that. I have a text field called 'source' in which there is somewhere (one or more times) some text like this: <strong>Submitted:</strong><span>17thOctober2013</span> I need to get the text "17thOctober2013" into a field called 'submitteddate' given that <strong>Submitted:</strong><span> will always mark the start of the text I want, but that </span> can subsequently appear many times within 'source'. There can be unlimited (probably<20) occurrences of <strong>Submitted:</strong><span> within 'source', hence I really need to create 20 fields called 'submitteddata_1' and 'submitteddata_2' and 'submitteddata_3' etc, unless there's a simple solution to auto-create the fields as many times as needed! What is the Calculation to best achieve this? Thank you. Philip Caplan
March 16, 201411 yr 1. It's not possible to create fields dynamically. 2. Having ~20 fields called 'submitteddata_1' and 'submitteddata_2' and 'submitteddata_3' etc, is not a good idea anyway. If an object has multiple dates of the same type, there should be a separate record in a related table for each. 3. Related records can be created programmatically by a looping script. A calculation can only calculate, it does not create anything. 4. There is probably a better way to handle this data to begin with. Having it in a text field may not be the best starting point.
March 16, 201411 yr Putting Comment's points into action: see if the attached file helps you. ParseHTML_eos.fmp12.zip
March 16, 201411 yr Author comment and eos Thank you, but what you suggest does not look to be of use for my needs, because, as I explained in my post I need to "massage-and-output text", not to create a properly-structured database application. I prefer the fields to all be in one table, so that I can later 'export' text. Making separate tables will either complicate this process, or exceed my knowledge of Filemaker!
March 16, 201411 yr I am fairly certain that having a "properly-structured database application" will make it easier to "massage-and-output text" - not "complicate this process". After all, that is the very purpose of having a proper structure. It's not done out of sense of duty or commitment to a dogma. If you care to explain more about the nature of the required processing, we could put this assumption to a test. I will, however, give you a simple example: converting the text "17thOctober2013" to a proper date (which could then be exported as "October 17, 2013" or "2013-10-17") would be a matter of adding one calculation field. In your method, you would need 20 of them. In any case, the number of fields in a table has to be established in advance. So if you cannot be absolutely sure that every record will have less than 20 (or any other arbitrary number) dates, this path is closed to you.
March 16, 201411 yr I prefer the fields to all be in one table, so that I can later 'export' text. Making separate tables will either complicate this process, or exceed my knowledge of Filemaker! It is just as easy to export from related table as from parent table. Once you understand a bit more, you will see what Comment speaks is absolute truth. And, Philip, we are here to help you through it. As you study and learn, ask questions if you get stuck. Everyone here is really nice and you are not alone in it.
Create an account or sign in to comment