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.

Performing multiple Find/Replace style Finds on same Text Field

Featured Replies

I have a long stream of based text that I need to parse information from. eg:-

0

This is a record

123

1

This is another record

456

.

.

etc..

I need to extract the data

0, 'This is a record', 123

1, 'This is another record', 456

.

.

etc..

My thought is to put this text in a global field and then perform a find/replace style find within the text field, searching for the tag, setting a $start variable to ActiveSelectionStart +4 (to get to the start of the text jumping over the ) Then searching for and setting $length to ActiveSelectionStart - $start.

It should then just be a case of using the Middle function to get the text and put it into a record.

Performing the same task for the other tags.

Unfortunately firstly I'm having difficulty selecting a field to perform a 'find/replace' style find from within a script.

The script step says Go To Field and then the next step is Perform Find/Replace ''

However, the script returns the error

The Find/Replace Option 'Current Field' requires a selected field
. Surely that's what the first step does ? If I click into the field before calling the script it works fine (for the first tag).

I'm also struggling, after setting the script puts the first recovered data into a field, getting the cursor back to the last position in the original (long text stream) text field to continue the search. I know the cursor position by using ActiveSelectionStart, but there's no option to 'SetCursorPosition' or anything similar.

If anyone has any better suggestions I would be very grateful and open to suggestions. ???

Thanks

Gary.

Edited by Guest

Where is this text coming from? Filemaker can import XML sources directly (given a suitable XSL stylesheet).

  • Author

It's coming from an obscure piece of software from a client. I don't think the file is pure XML unfortunately and Filemaker has a problem importing directly into records because some of the text doesn't register. Because each problem line is different it's difficult to do a find and replace to remove them.

All I'm after are the 3 bits of information coloured red below.

The text that's repeated for 800 records shown below:-

[color:red]107

102

Statustext

0

320

false

1

false

A16

false

-1

[color:red]Startbereit

[color:red]Ready to Start

Edited by Guest

It's certainly possible to extract the data - see:

http://fmforums.com/forum/showpost.php?post/289685/

If you use a script variable to count the records, you could have the script create the 800 records automatically in a loop.

  • Author

I think "position" may be the function I was looking for, many thanks :)

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.