Skip to main content

Turning <p> and </p> into line breaks in a field

  • June 4, 2023
  • 1 reply
  • 28 views

Forum|alt.badge.img

Hello, all. I am importing a CSV file into Airtable. Some of the CSV data ends up as Long Text fields in Airtable, and consists of blocks of text with multiple paragraphs. It comes in with <p> and </p> indicating these paragraphs.

In Airtable, the <p> and </p> are preserved and the text is just one giant block with no breaks. What I would like to do is process these files to restore the line breaks as they're intended. I tried doing a search and replace to replace the HTML tapes with \n, but it didn't work. I'm not sure if I understand why, but I am guessing that \n is useful in the case of multiple fields being strung together with line breaks, not a single field that needs to have its line breaks preserved.

If anyone has any ideas on how to accomplish what I need--preserving line breaks in fields brought in via CSV--I would appreciate it, Thanks!

1 reply

TheTimeSavingCo
Forum|alt.badge.img+31

Hmm, what if you tried something like:

SUBSTITUTE( SUBSTITUTE( Notes, "<p>", "" ), "</p>", "\n" )