Extracting text between two Str Delimiters


I would just want the “the text i want” and unfortunately what follows could be number or text and could be more than one string!

But I think the : will help me. Working on it now

Not sure why this has started happening,

This part of the sequence finds whether there is data in the txt (pdf) or not. If not then moves the file. But for some reason now it has continued to extract further data from later sequences from that file ?!!

What further data does it extract? Do you mean that “Name Arabic:” is not working as a delimiter any more?

After name I’m then extracting email address, phone number, project name, property number, and some more. Each with its own difficulties.

But the name extraction is fine. Just in that sequence above, which is the first sequence, if there is no name then i want to move the file and move onto the next. But I seems to be moving the file but still taking the data and putting it into excel

And what is your condition in IF? That GoodPDForNot? Also, perhaps it starts making sense for your to either begin posting each issue separately to let others keep the track and help you, or to send them via messages to me :smile:


If that text doesn’t exist in the txt file then there is no data in it and I don’t want to process it any further and move it to another folder

From the most recent changes you have mentioned adding a colon into your allowed characters - perhaps something with it is affecting your condition… Would it work for you to re-write the condition to: ‘PDFText.Contains(“SECOND PARTY”) and PDFText.Contains(“BUYER”) and PDFText.Contains(“NameEnglish”)’ - if “NameEnglish” is really the text you are looking for and not some your string variable name - then it would be put without these quotation marks. Please see the syntax advised below:


Annoyingly this became very easy once I had put the colons in. All done now apart from the move file problem

The sequence does detect whether there is data or not and moves the file accordingly but then continues the work flow with that file extracting data and putting it into excel. I want to move file then stop processing it

I don’t know your whole workflow, but I am guessing that probably this unwanted file sticks incorrectly to some variable which you are processing further (hence it is actioned anyway), e.g. it is always worth to check how your For Each is built and what it uses, as well as what your condition If contains… I am just curious - have you applied my “PDFTest.Contains” version? Does this problem with Move file still persist?

Let me check this. I might be talking nonsense. Let me run the files again

So, it moves the files ok once detected no data. But still does add random stuff into the excel sheet.

Is there no way of stopping processing the file once moved.

Every extraction process is inside one ForEach file in directory.getifles etc.

I have done it like this so it writes data row after all data extracted per file.

So absolutely every part where your automation is pulling out any data from the files and then entering it into an excel is included in your “Then” of your IF condition PDFTest.Contains? Or is any part like this left outside your condition?

Only buyers name extraction is in “then”. Then the rest is after

I guess that’s the answer :slight_smile:

I need to put everything else into “then”?

Put it in a separate sequence and invoke to the “then”??

I would start from here :slight_smile: You may test it first though by placing just a part and see if this "affects the effect ".


You will be glad to know it works.

All that work for a 2 minute process haha. 20000 files done!!

Thanks a lot for your help

1 Like

Yeah, awesome! :partying_face: Happy to know it all works and does its job! All’s well that ends well :sweat_smile:

Almost… haha

One of my extractions does regex between “plotnumber:” and “type of area”.

Then it splits with :

In this one instance there isn’t any and it returns index was outside of bounds if the array. (I’m using index 1) because this works apart form this once :roll_eyes:

Check the below thread - any suggestion there helps you?

Sorted with a count of :

If none then put default text for that bit of data otherwise continue as normal.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.