Jump to content

Replace Utility - how to insert a line break?


Recommended Posts

I want to make a simple replacement to convert a multi-line block of text into a more html-friendly format.

 

example:

Have this...

  quick

  brown

  fox

Want this...

  quick<br/>

  brown<br/>

  fox

 

I've got a workflow Replace utility that looks like this:

image.thumb.png.e92ba1de9dc0ec9e743971ebaed335f7.png

 

My result is this...

  quick<br/>/nbrown<br/>/nfox

 

I'm guessing my escape character in the replace field is totally wrong.

 

Any suggestions?

Link to comment
  • 1 year later...

image.thumb.png.ddebdeb0ceceadcf22d91de49c3c5e28.png


Hi, I am trying to append notes to a textfile and would like to add a line break, for which I want to use a replace character such as a pipe. But whatever I do, the text doesn't get replaced. I also tried string replace.

 

I tried everything and am without clue, do you have any idea?

Link to comment

Sorry, it's not clear what you're doing from your screenshot (that's why we ask you to always upload your workflow, so we can have a look).

 

If you want to use a line break in Alfred's replace element, you have to paste a literal line break. Escapes like \n don't work. Copy and paste a line break from a text file. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...