Using Lists in Your Cleaners

Tutorial

Lists are a powerful feature in TextSoap 8. Rather than creating individual find and replace actions for each piece of data, you can create a template find and replace action and connect it to a list of data. The action is then applied with each row of the data.

Two actions take advantage of Lists.

Let’s create an example using Batch Create Hyperlink URLs. This action will take matches found and covert them to hyperlinks in Rich Text.

For URLs like https://www.unmarked.com or https://www.apple.com, we could just use the cleaner ‘Convert URLs to Hyperlinks’.

But in this example, we want to take references to ‘Unmarked Software’ and ’Apple and link them to the appropriate URL.

First, we create a new cleaner.

We’ll create a simple example.

We’ll switch over to the list editor.

And fill in some data. Column A will be our company name, and column B will be the URL.

For this example, we’ll have any entry for Unmarked Software, Apple, and TextSoap.

Now, here’s a little sample text to process.

Unmarked Software prepares for the release of macOS Sierra from Apple. TextSoap 8.1 has been tested against macOS Sierra and looks to be compatible.

Because we want to create hyperlinks, we’ll create a rich text version.

And here’s what the preview looks like:

With this cleaner, we can now add a name and URL to the list data to handle more hyperlinks.

HTML Hypertext

Let us continue with this example and instead of a hyperlink, let’s say what we wanted was an HTML <a> reference instead.

One option might be to use the Hyperlinks to Text action. Let’s add the action after the Batch Create Hyperlink URL:

When we preview it, we get:

Unfortunately, the text is still hyperlinked and we didn’t want that.

Customize Batch Find and Replace

Let’s delete the two actions and add a Batch Find and Replace Text action instead. The list data is not affected by this.

Now we’ll create an <A> reference using our column tags.

<a href="$v{col:B}">$v{col:A}</a>

Now when we preview the text, we get the HTML, but it is no longer hyperlinked.

That’s a brief look at some of the things you can do with Lists.