Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cool11

macrumors 68000
Original poster
Sep 3, 2006
1,777
220
I am having a site and I update it with many texts that came from word documents.

For many years (pc days and now on mac), I have to manually insert the <p> and </p> html tags in the starting point and the ending point of each paragraph of each document, in order to appear as it should appear in my web page.
The web page is dynamic, so I have to do this thing all the time , adding these tags in order to have the right interpretation from html parser of the server and the paragraphs to be displayed as separated paragraphs and not an one paragraph text.

I am searching a way to do this weary task automated.

Create, somehow, a procedure, of adding <p> tag to the start of each paragraph of the document, and </p> to the end of it.

Can you please suggest me something?
 

JNB

macrumors 604
First, assuming you separate paragraphs with a space between them through the use of two <CR> (or similar), then do a global Search & Replace in the document for: <CR><CR>

and replace with </p><CR><CR><p>

Then, you only have to manually place the correct formatting instructions at the beginning of the first paragraph and the end of the last one.

EDIT: In Word, this is what it looks like, before & after (the CR character is ^p)
 

Attachments

  • Find and Replace before.jpg
    Find and Replace before.jpg
    74.3 KB · Views: 63
  • Find and Replace after.jpg
    Find and Replace after.jpg
    73.4 KB · Views: 75

cool11

macrumors 68000
Original poster
Sep 3, 2006
1,777
220
I really don't understand what is the <CR>.
Where is this on word documents?
 

cool11

macrumors 68000
Original poster
Sep 3, 2006
1,777
220
How do you write ^ on find-replace box?

edit: ok, I copied your symbol, not the best way to do it of course.

It seems to work as you said. It would be nice to save the search-replace string somehow and not to have to write it from the start every time I wanna do these replacements.

At last, it is one step forward to the desired automation, but I hoped there was a more straightforward procedure.

Thank you JohnNotBeatle.

If somebody has a better idea I will try it. Till this momment I will do it the way you write it here. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.