# ¿Cómo se usa remap para insertar un salto de línea?

**URL:** <https://meta.discourse.org/t/how-do-you-use-remap-to-insert-a-newline/100531>\
**Category:** Support\
**Created:** [26 Octubre, 2018 09:29 UTC](https://meta.discourse.org/t/how-do-you-use-remap-to-insert-a-newline/100531 "2018-10-26T09:29:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lxk](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lxk](https://meta.discourse.org/u/lxk)\
**Post date:** [26 Octubre, 2018 09:29 UTC](https://meta.discourse.org/t/how-do-you-use-remap-to-insert-a-newline/100531/1 "2018-10-26T09:29:26Z")

</div>

Hi Team,

I Imported a phpBB forum which has a whole bunch of broken hotlinked images from a Coppermine gallery in the user’s posts.

I got copies of the original images from an old backup, have re-hosted them and I’ve had success using the posts remap and delete rakes to fix up mangled post formatting so Discourse will inline the images, and then crawl them.

I’ve hit a bit of a wall with some formatting, does anyone know how I can squeeze a newline between these image URLs?

`http://picture.url/image.jpghttp://picture.url/image2.jpg`

I tried

`rake posts:remap['.jpghttp://','.jpg<br/>http://']`

This works visually, though because the text is still all in a single string, it’s not inlining the image. I’ve validated putting a newline between the URLs works, there’s just too many to do by hand - is there a trick I’m missing?

Ideas?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [26 Octubre, 2018 10:51 UTC](https://meta.discourse.org/t/how-do-you-use-remap-to-insert-a-newline/100531/2 "2018-10-26T10:51:46Z")

</div>

Use `\n` instead of `<br>`.

EDIT: maybe `\\n`?

---

<div class="post-metadata">

**Author:** ![lxk](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lxk](https://meta.discourse.org/u/lxk)\
**Post date:** [26 Octubre, 2018 15:21 UTC](https://meta.discourse.org/t/how-do-you-use-remap-to-insert-a-newline/100531/3 "2018-10-26T15:21:45Z")

</div>

I thought that too, but that puts an ‘n’ between

doesn’t appear to accept regex, escaping it didn’t seem to work

---

<div class="post-metadata">

**Author:** ![lxk](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lxk](https://meta.discourse.org/u/lxk)\
**Post date:** [26 Octubre, 2018 16:09 UTC](https://meta.discourse.org/t/how-do-you-use-remap-to-insert-a-newline/100531/4 "2018-10-26T16:09:23Z")

</div>

I needed both `\r\n` not just `\n`

Ended up using the database instead of remap

`update posts set raw = replace(raw, '.jpghttp', '.jpg\r\nhttp');`

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [28 Julio, 2021 23:11 UTC](https://meta.discourse.org/t/how-do-you-use-remap-to-insert-a-newline/100531/5 "2021-07-28T23:11:17Z")

</div>


