Pull multi line entry info and paste into a spreadsheet

I'm using Text Blaze to capture information from a web site and paste it into a Google Sheet. And I'm running into issues when the original text on the website has more than one line. An excerpt from example report is attached.

When the interpretation has only one line in it, the snippet works fine.
{note}Specimen{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=.MuiBox-root > .MuiPaper-root :nth-child(1) > p.MuiTypography-root}{key: tab}{note}Interpretation{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=.MuiBox-root > .MuiPaper-root :nth-child(3) > p.MuiTypography-root; frame=self; select=ifneeded} {key: tab}{note}Date{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=.MuiBox-root + .MuiBox-root > .MuiBox-root + .MuiBox-root + .MuiBox-root > .MuiBox-root + .MuiBox-root}{key: tab}{note}Name{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(1) > :nth-child(2) > .css-1v1bakh-text}{key: tab}{note}Age{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(5) > .css-1v1bakh-text}{key: tab}{note}Sex{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(8) > .css-1v1bakh-text}{key: tab}{note}Breed{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(7) > .css-1v1bakh-text}{key: tab}{note}Clinic{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:last-child > :nth-child(1) > .css-1v1bakh-text}{key: tab}

See line 2 in this example spreadsheet.

BUT, if there is more than one line in the interpretation, use of {key: tab} after the interpretation causes the snippet to mangle data entry into the spreadsheet. -- see lines 5, 6 in the example spreadsheet

Use of {key: rightarrow} instead of {key: tab} will keep things moving along the same row, BUT... will insert the interpretation information into TWO rows in the spreadsheet. -- see lines 8, 9

{note}Specimen{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=.MuiBox-root > .MuiPaper-root :nth-child(1) > p.MuiTypography-root}{key: tab}{note}Interpretation{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=.MuiBox-root > .MuiPaper-root :nth-child(3) > p.MuiTypography-root; frame=self; select=ifneeded} {key: rightarrow}{note}Date{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=.MuiBox-root + .MuiBox-root > .MuiBox-root + .MuiBox-root + .MuiBox-root > .MuiBox-root + .MuiBox-root}{key: tab}{note}Name{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(1) > :nth-child(2) > .css-1v1bakh-text}{key: tab}{note}Age{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(5) > .css-1v1bakh-text}{key: tab}{note}Sex{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(8) > .css-1v1bakh-text}{key: tab}{note}Breed{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:nth-child(7) > .css-1v1bakh-text}{key: tab}{note}Clinic{endnote}{site: text; page=https://app.vetscanimagyst.com/; selector=:last-child > :nth-child(1) > .css-1v1bakh-text}{key: tab}

When I write a snippet to capture ONLY the information in from the interpretation, it will again insert both lines into a singe cell -- see C11. and will work correctly with either {key: rightarrow} or {key:tab} provided there are no other commands in the snippet
{note}Interpretation{endnote}{site: text; page=https://app.vetscanimagyst.com/*; selector=.MuiBox-root > .MuiPaper-root :nth-child(3) > p.MuiTypography-root; trim=yes; multiple=no; select=ifneeded; frame=self}{key: rightarrow}

Is it possible manipulate the data capture when there are multiple lines to allow it to copy multiple lines (some reports have 3 or 4) into the same cell? Should I be able to leverage any of the Data type, select, frame, or trim commands on the far right to help with this?

I'm having the same problem with reports where the Specimen portion has more than one line, and a couple other similar scenarios.

Thanks very much,
Carol Haak

Hi,

It sounds like you are running into an issue where pasting multiline text into a Google sheets cell creates multiple cells instead of pasting it into a single cell. Is that right?

If so, I don't know if there is a way to do exactly what you want as I think Google Sheets will always create new cells when pasting in new lines. However you could replace the new lines in your text with a space or another character prior to pasting which I think would work well for you.

This can be done using the replace function and a Text Blaze formula.

For example:

Input text: {formparagraph: default=text with
new
lines; name=text}

Original text: {=text}

Text with newlines removed: {=replace(text, "\n", " ")}

You would wrap each of your site commands in the replacement formula so you would end up with formulas like: {=replace({site: ...}, "\n", " ")}

Does that help?

Hey again @carol.haak !

Google Sheets allows you to paste multiline text into a single cell provided you press Enter inside it first. So, for example, a snippet like this pastes text across cells:

a{key: tab}b
c

image

In this case, you can add {key:enter} after the tab to force pasting inside a single cell, like so:

a{key: tab}{key: enter}b
c{key:tab}{key:enter}d
e{key:enter}

This snippet gives us this result:

Let me know if it works for you!

1 Like

oh wow!! It is working! My whole team thanks you. <3

Carol

1 Like