HTML Finding & Editing

Hi Guys,

I’m so close to getting what I need, and I was hoping for some help of getting this flow over the line.

The premise is that I want to extract certain Data from a Brief: Brief.docx (36.9 KB)

Then convert this to a HTML file, then replace some text, then copy and paste this to a web field of code.

The flow here: Main.xaml (88.2 KB)

This almost works fine, although when I am replacing text in the HTML file, it doesn’t come out for all the replacements; particularly the ‘£/€700’ part.

All numbers formatted in this way need to be replaced like this #amount=700GBP# which is what is happening for all numbers bar this one, from what I can tell this is because adding this ‘GBP#’ ending on this particular bit of code jumps it to a new line, and returns the value ‘#amount=700’ with no ending. This number is also in a Bullet point section, which could also be effecting things.

Does anyone have any thoughts of a way to retain this ending for this number, or in instances such as these?

Many Thanks!

Hi @Kyleb91

If you are not able to directly put what ever you need to replace inside replace what you can do is

Make a text file and keep what ever you need to replace in that text file (assume you have . -dot-). now read that text file and your output variable (assume str) from read text file will contain that your .(dot)

Now use this variable (str)

stringword.replace(str,“”)

Regards
Roshan

Please mark as solution if found useful :slight_smile:

1 Like

Hey man thanks for the help, but the location of the text can vary, as well as the amounts.

I’m not sure I quite understand your technique here and what the flow attached isn’t already doing.

@Kyleb91

Am not able to open your workflow because project.json file is missing. From what your problem statement what i understood is that .replace method is not working for few of the strings in your html text. especially a Bullet Point (.)

Correct me if am wrong

Yes @unknownay that’s it, because the replace at the end would cause this to go to the next line, from what I can tell.

@Kyleb91

So what you need to do is put that character (dot) in a text file and read the text file. Now use that variable to to replace.

Can u zip and attach the project and expected output.

Regards
Roshan

Apologies for not attaching before: Word_To_PDF_HTML.zip (142.9 KB)

It’s in the Main.xaml

What is your expected output

1 Like

It’s the Terms and conditions section at the end, all text in between the '^'s. But with all currencies eg: £/€700 in the format #amount=700GBP#. Everything replaced accordingly and the output remaining in the same format.

can you put in a text file and give

Hey, sorry see below, this is the file after converted at the start of the flow, outputting just the T&Cs to .HTML for reading:

Brief_html.html (121.0 KB)