In Pages, trying to bold everything that is inside {curly brackets} I have a source document that I'm trying to clean up, it's essentially plain text. But the author has bold text indicated with { } brackets, and italics indicated with &lt; > brackets.

I would like to be able to automatically convert these to the proper style. Is there a way to accomplish this? It's nearly 200 pages, and on some there are 30+ instances on a single page. This will be weeks of work at the rate I'm going.

I've got the latest Pages (and no older version to fall back on). Is there a way to do this?
I would recommend simply editing the file in .rtf, as it contains support for bold and italic but isn't anywhere near as complex as Pages files.

RTF uses a tag based system denotes certain properties with the backslash "\" as the control word, which is somewhat human readable.. Take a look at these two pieces: one the formatted .rtf and the other the plaintext (or code.)


  This is a test.


{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww10600\viewh10400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\fs24 \cf0 This 
\b is
\b0  
\i a
\i0  test.}


Stripping out the metadata, we still have a valid .rtf file, just with less formatting (which we don't need anyways.)

{This 
\b is
\b0
\i a
\i0  test.}


We don't even need those newlines.

{This \b is \b0 \i a \i0 test.}


With this, it becomes pretty trivial to convert your text: all we need is find and replace. First, create a .txt with all the data and open it in your favorite text editor–even TextEdit will do. Simply find and replace:


{ with \b
} with \b0
&lt; with \i
&gt; with \i0


Note the whitespace (you may have to open the markdown code to see it.)

All we need to do now is add a curly brace at the start and the end, and we're done!

Lorem ipsum dolor sit amet, {consectetur adipiscing elit.} Donec placerat turpis in ligula ullamcorper, eget finibus ligula pretium. Etiam pellentesque {rutrum varius. Proin non} nunc quam. Pellentesque vestibulum quam enim, ac mollis metus venenatis eget. Vestibulum purus nulla, gravida quis erat ac, &lt;luctus venenatis nunc. Pellentesque ac posuere dolor, sed tincidunt arcu.&gt; Duis sodales magna justo, non porta turpis &lt;aliquam eu. Etiam tempor, enim eget maximus tincidu{nt, orci justo} consequat erat, ac elementum justo enim ullamcorper ex. Nunc libero ex, efficitur eget neque commodo, tempus hendrerit ipsum. Ut id placerat&gt; mauris, eu porta nulla. Donec ultrices lectus non elit condimentum sollicitudin. Mauris molestie felis eget hendrerit lobortis. Cras scelerisque et tellus nec ultricies. Nam nisi urna, vehicula eget posuere sed, interdum eu {sem.}

Lorem ipsum dolor sit amet, \b consectetur adipiscing elit. \b0 Donec placerat turpis in ligula ullamcorper, eget finibus ligula pretium. Etiam pellentesque \b rutrum varius. Proin non \b0 nunc quam. Pellentesque vestibulum quam enim, ac mollis metus venenatis eget. Vestibulum purus nulla, gravida quis erat ac, \i luctus venenatis nunc. Pellentesque ac posuere dolor, sed tincidunt arcu. \i0 Duis sodales magna justo, non porta turpis \i aliquam eu. Etiam tempor, enim eget maximus tincidu\b nt, orci justo \b0 consequat erat, ac elementum justo enim ullamcorper ex. Nunc libero ex, efficitur eget neque commodo, tempus hendrerit ipsum. Ut id placerat \i0 mauris, eu porta nulla. Donec ultrices lectus non elit condimentum sollicitudin. Mauris molestie felis eget hendrerit lobortis. Cras scelerisque et tellus nec ultricies. Nam nisi urna, vehicula eget posuere sed, interdum eu \b sem. \b0


Things to note: RTF doesn't support non-ASCII characters by default. If you need/want to use them, you'll need to do enter them specially using the \u control.