flemmings: (Default)
flemmings ([personal profile] flemmings) wrote2010-04-04 11:15 pm
Entry tags:

Time travelling again

All this talk of Dorian reminds me of my first Dorian story, A Garden in Paris. And then in a burst of utter brilliance, I think 'Wonder if there's a Streetview for the Rue Galande?' There is. And it's as narrow as I'd hoped. The only problem is that all the buildings are at least four storeys if not five or six, not the three I put in, and of course each floor is a separate apartment with no interior stair cases. Ah well, poetic licence: I wrote the thing in Tokyo and picked a likely looking street off a map.

(The fomatting of the story is a mess. I'd hand code a cleaner version but seem unable to find a way to do search and replace on whatever Word's marker for italic is, so as to convert it to < em >. Someone said it could be done but neglected to mention how. All I can discover is how to turn italics into bold or whatever, which is no help.)
doire: (Default)

[personal profile] doire 2010-04-05 11:10 am (UTC)(link)
I love streetview. The other day I used it to "walk" to a shop I wanted to contact, but couldn't remember the name or address of. And now I know!


Are you using Word's html format or making a cleaner tet file? You probably know Word's own format is bloted with MS extensions.

To make a plain text markup:
find and replace any character in italics by <em>found text</em>
find and replace </em><em> by nothing

repeat for other character formating substituting as necessary

add <html><body> at the beginning and </body></html> at the end

Save as a text file, but put the file name in quotes and put .htm or .html
Eg "my_file.html"

If this could be useful I can expand on it if necessary (or write some macros to do it automatically. I shpuld have some around from when I do this for myself.)

edited to put angle brackets that won't be htmled.
Edited 2010-04-05 11:14 (UTC)

[identity profile] flemmings.livejournal.com 2010-04-05 12:27 pm (UTC)(link)
Streetview is great, except that they update, and you lose the picture of the building that was there six months. I know-- present usefuless trumps past nostalgia.

I'm trying to handcode a .rtf version of my document. The .html format in Word has much too much coding to tackle.

find and replace any character in italics by < em> found text< /em >

Yes, but how do I do that using Word's Find/replace function? Rather than going through the document myself and hoping I see all the italicised words?

find and replace </ em>< em> by nothing

I know this is going to sound dumb, but how do I enter nothing in the 'replace with' box? If I leave it blank, won't Word treat it as a simple find operation?

Save as a text file, but put the file name in quotes and put .htm or .html

So Word will save it as "my_file.html".txt? But when I upload it, won't it refister as just as a.txt file?

doire: (Default)

[personal profile] doire 2010-04-05 04:27 pm (UTC)(link)
I think I broke the comment trying to put screen shots in.:( I'll try in words, but if it's gibberish I can try again with pictures.


In find and replace there is a "more" button which gives you more choices. Click it to use them.

With the cursor in the find box, click on format, then font, then italic in the style choices and then okay. Type ^? in the find box.

With the cursor in the replace box, type <em>^&</em>

(You can pick ^? an ^& from a list in the "special" menu, but it's easier to type them. ^? is any character and ^& is whatever you found.)

Click on replace all.

This is italic text. will change to
This is <em>i</em><em>t</em><em>a</em><em>l</em><em>i</em><em>c</em> text.

Start find and replace again. with the cursor inthe find box and more options showing, click on format, font, delete italic from the style menu and click okay. Type </em><em> in the find box.

Delete any text from the replace box. If there is nothing there the command is more of a find and delete.

choose replace all.

You should end up with This is <em>italic</em> text.


There are two things going on with the save as.
The way the file is coded needs to be txt. Html files are just plain text. But you want it to be recognised as an html file so the extension needs to be htm or html.

Changing the save as file type to text changes the encoding. It also automatically adds a .txt to the file name unless you put quotes round the name you want to use. You could just save as text and change the file name afterwards if that makes more sense.

Oh, and always, always save a copy of your file before doing a global find and replace.


I'm sorry if it looks daunting; it far longer to type than it does to do it.

[identity profile] flemmings.livejournal.com 2010-04-05 05:21 pm (UTC)(link)
So basically, what I must do is italicize every letter doing search and replace. because the S&R function won't do it for whole words? OK. Somehow I'd have thought there'd be an easier way, but MS' html seems to have a fondness for excess code anyway.

[identity profile] mvrdrk.livejournal.com 2010-04-05 05:40 pm (UTC)(link)
There's a tool that will clean up MS's html for you, which you might try.
You can find it at http://www.w3.org/People/Raggett/tidy/ or you can email me a sample and I can try to find a web service for you that will clean it up.

[identity profile] mvrdrk.livejournal.com 2010-04-05 05:47 pm (UTC)(link)
http://www.webmastersherpa.com/content/useful-code/cleanup/

Might be a better solution for you than my previous suggestion. Sorry.
doire: (Default)

[personal profile] doire 2010-04-05 10:08 pm (UTC)(link)
Fraid so. There is a point when each letter is emphasied individually though it shouldn't last.

This is rather clunky, but each step is pretty fool-proof. It can be streamlined by turning it into macros or VBA code, but the more powerful a tool you use the more potential for disaster there is.

[identity profile] flemmings.livejournal.com 2010-04-05 10:39 pm (UTC)(link)
I've never ever got a handle on macros just for a start. Thanks for this.

[identity profile] flemmings.livejournal.com 2010-04-05 10:48 pm (UTC)(link)
There's actually a whole bunch of 'clean up HTML docs' programs, and they're fine if you've already saved the thing as an .htm document. But what if I want to hand code a story I've written and saved as .rtf? How do I do that in the simplest way possible?

I can search and replace the hard returns in a single step. I can use css for indents if I want them. But italics, bolding, and underlines require the Byzantine search and replace operation described by doire above. Or else go through the ms and insert the em /em tags before and after every italicized word. This strikes me as clunky and really stupid.

[identity profile] mvrdrk.livejournal.com 2010-04-06 03:59 am (UTC)(link)
What version of word are you using these days?

[identity profile] flemmings.livejournal.com 2010-04-07 04:11 am (UTC)(link)
2003, it seems.

And now I'm having weirdies. Did I ever send you back your Office 2007?

[identity profile] mvrdrk.livejournal.com 2010-04-08 12:55 am (UTC)(link)
If you did, it never arrived.

What you should do with your .rtf file is open it in word 2003, and save it as "filtered html". That will give you html that can be sent through the various clean up programs. Keep the .rtf file as your original, use the html as a throw away file to figure out if you can clean it up to your liking.

[identity profile] mvrdrk.livejournal.com 2010-04-08 12:55 am (UTC)(link)
Or I've forgotten that it arrived. Which I do often these days.