Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Pulling my hair out..text parsing

Featured Replies

I am pretty new to Filemaker,and maybe trying to bite off more than I can chew...story of my ilfe..

 

I have used the GetUrl script and pasted html data into a field called "url_g".   In this HTML I am attempting to get some data out of 4 tables and put them in their respective fields.

 

I have tried numerous scripts to accomplish this, and am really struggling.  A sample of the HTML code is below:

 

 

<tr class="ysprow1" align="right" height="16"><td class="yspscores" align="left">&nbsp;2010-11</td><td class="yspscores" align="left">ATL</td><td class="yspscores">77</td><td class="yspscores">34:17&nbsp;</td><td class="yspscores">6.5</td><td class="yspscores">13.5</td><td class="yspscores">47.7</td><td>&nbsp;</td><td class="yspscores">0.7</td><td class="yspscores">2.0</td><td class="yspscores">33.1</td><td>&nbsp;</td><td class="yspscores">3.0</td><td class="yspscores">4.1</td><td class="yspscores">72.5</td><td>&nbsp;</td><td class="yspscores">1.7</td><td class="yspscores">6.8</td><td class="yspscores">8.5</td><td>&nbsp;</td><td class="yspscores">3.3</td><td class="yspscores">2.6</td><td class="yspscores">1.3</td><td class="yspscores">1.6</td><td class="yspscores">2.8</td><td class="yspscores">16.5</td><td>&nbsp;</td></tr>

 

Every number in this code needs to be placed in a particular field.  To start I was simply trying to parse this text to a separate field so I could attempt to parse each number.   

 

Now, I am here begging for help.  Is this even possible?  I watched a video of a somebody doing it, but he made assumptions I did not understand.  I have googled "parse data" and most of the examples are very simple.

 

What I have tried is to Set a variable at word "ysprow1" and "ysprow2" (the beginning of the next table).  I then attempted set a variable using the Middle function.  I ran the script and it crashed FM.   

 

Here is a copy of the script I was using last

 

 

#Parse the Tables out of the Code

#First Table
Loop

Go to Record/Request/Page[ First ]

Set Variable [ $t1beg; Value:Position ( NBA Players::url_g; "ysprowl1" ; 1 ; 1 ) ]

Set Variable [ $t1end; Value:Position ( NBA Players::url_g; "ysprowl2" ; 1 ; 1 ) ]

Set Variable [ $table1; Value:Middle ( NBA Players::url_g; $t1beg ; $1tend-$t1beg ) ]

Set Field [ NBA Players::url_l_table_1; $table1 ]

Go to Record/Request/Page

[ Next; Exit after last ]

End Loop 

 

I know this is the part where experienced FM designers are laughing..I deserve it :)  Any help would greatly be appreciated..

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.