Replace comma with linebreak

Let's say I have an address:

place name, name of the street, city, postcode

I want to copy it into the clipboard, but then replace the commas with a comma+line break in the following formula:

{address={clipboard}}{formparagraph: name=address; width=40; height=6}

How do I use the replace command in there?

Thanks

You could do something like the following. Just replace the hardcoded address with {clipboard}.

{address="123 Main Street, USA"; trim=right}

Original Address
{=address}

Modified Address
{=replace(address, ",", ",\n")}

1 Like

Great! Works like a charm. Thank you so much :grinning:

Hi,

I'm very much a newbie and only started getting this working at all for me. It seems great in combination with Workflowy BUT:

When I use the above example in Workflowy i get:

* Original Address
* 123 Main Street, USA

* Modified Address
* 123 Main Street, 
      *USA

This is close to what i need but i need a 'soft' line break to avoid workflowy creating a new 'node' (as it's known in Workflowy)

In Workflowy it looks like you can insert a line-break from a top level node via shift-enter, you can replicate this in Text Blaze with the key command:

For example:

Top level text{key: shift-enter}More text on a new line that won't be made into a new node

@Dave_Zoo_Logical, I confirm that Scott's suggestion works. I've just tested it myself.

Item main{key: shift-enter}Item sub

Not that you should keep the command on the same line, otherwise you'll get extra line breaks, which you don't want.

HOWEVER, here's a little hack for you. If you want a more understandable snippet, you can put line breaks and then use the trim setting to get Text Blaze to clean them when it renders the snippet.

See my example below. Also, try changing trim=yes to:

  • trim=left
  • trim=right
  • trim=no

and see what happens.

Item main
{key: shift-enter; trim=yes}
Item sub

If you have any other questions, let me know :slight_smile: