Automatically reformatting frequently copied data

Hi,
I have vital signs of I am copying and pasting from the EMR. Below is an example of what it looks like when it is copied and pasted.

BP: 130/66 mmHg
11/8/2021 04:20

Temp:97.5 °F
11/8/2021 00:37
Pulse: 64 bpm
11/8/2021 04:20
Weight: 186.6 Lbs
11/5/2021 00:08
Resp: 18 Breaths/min
11/8/2021 00:37
BS: 118 mg/dL
11/3/2021 12:49
O2: 97 %

I would like to automatically be able to remove the dates and have 3 (spaces) between each vital type. An example of what I want it to look like:

BP: 130/66 mmHg Temp:97.5 °F Pulse: 64 bpm Weight: 186.6 Lbs Resp: 18 Breaths/min BS: 118 mg/dL O2: 97 %

Thanks in advance!

Hi @Amy_Choy - welcome to the forum :slight_smile:

Text Blaze automatically collapses multiple spaces, so there isn't really a practical solution for separating each item by three spaces.

However, if you're ok with having a different separator, you could do it this way.

The first example is just to show you how it works. The second example is what you should import into your Text Blaze dashboard.

{note: preview=no}
{data="BP: 130/66 mmHg
11/8/2021 04:20

Temp:97.5 °F
11/8/2021 00:37
Pulse: 64 bpm
11/8/2021 04:20
Weight: 186.6 Lbs
11/5/2021 00:08
Resp: 18 Breaths/min
11/8/2021 00:37
BS: 118 mg/dL
11/3/2021 12:49
O2: 97 %"}
{endnote: trim=right}

{=join(filter(split(data, "\n"), item -> item <> "" AND not testregex(item, "\d\d/\d\d?/\d\d\d\d")), " | ")}

The example below is for importing into your Text Blaze dashboard. It uses the {clipboard} command to read what you copied into your computer's clipboard and paste it in the format you want.

{=join(filter(split({clipboard}, "\n"), item -> item <> "" AND not testregex(item, "\d\d/\d\d?/\d\d\d\d")), " | ")}

1 Like