Insert in list

J

JB

I have a word document (taken from ie-spyad in Notepad, and want to use it
fr a HOSTS file. For that I need to insert 127.0.0.1 infront of each
existing line.
How do do that in Word 2003?

Thank you

JB
 
H

Herb Tyson [MVP]

Insert a paragraph mark at the beginning of the first line, then press
Ctrl+H. Set:

Find what:^p

Replace with:^p127.0.0.1<spaces>

<spaces> means that you press the space bar however many times you think
appropriate, since you presumably want at least one space separating the
local IP from whatever follows.

After replacing all, delete the blank line at the beginning and the unneeded
127.0.0.1 at the end. And... don't forget to save the file as text (you
might need to rename the file afterward to remove an unwanted .txt from the
name)... and fix any lines that you didn't really want changed (such as
those beginning with #).

--

Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com
 
J

JB

Thanks Herb, but I'm a bit lost.

I had already tried the find/replace fixture, so it's nice to know I was on
the right rack, but...


Whar do you mean by paragraph mark at the beginning of the first line?

What do I put in Find? 'control p' does not place anything there!

I guess it is not Control p that you mean.

Help....


JB
 
J

JB

Ok, I got what you mean by paagraph mark, and managed to get something out
of the find/replace, but must be dong something wrong as it seems to place
the 127.0.0.1 everywhere except where I want it to be.

Possibly, I am not getting the control p as you mean it.

JB
 
J

JB

Where the lines start with letters (the site address) I get nothing
Where the line starts wirth asterisks it places the 127.0.0.1

What am doing wrong?

JB
 
H

Herb Tyson [MVP]

Note: when I said ^p, I meant exactly that--a caret followed by a lowercase
p. Not Ctrl+p, but ^p, literally. That's the Find/Replace symbol for
matching a normal paragraph mark.

From what you're saying, it sounds like there are non-standard paragraph
breaks for some lines (i.e., something that doesn't match ^p) and regular
paragraph breaks for other lines.

When I said "insert a paragraph mark at the beginning," I meant simply
"press Enter", and I was assuming that your hosts file began with an ip
number, rather than with a comment (line beginning with #).

Let's try this a different way (and I assume you're working with a copy of
the hosts file):

Select all of the lines you want to change--this will let find/replace
affect only the selected lines.

Press Ctrl+H

Set Find what: to ^13 (this will match normal and non-standard paragraph
marks)

Set Replace with: to ^p127.0.0.1<5 spaces> (I.e., press the space bar 5
times)

Click Replace all.

Say No to the prompt asking if you want to apply the find/replace to the
rest of the file.

You will need to add 127.0.0.1 manually to the first item, and remove the
extraneous 127.0.0.1 at the end of the list.

Does that do it?

--

Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com
 
J

JB

Thank you very much Herb

It worked!


JB




Herb Tyson said:
Note: when I said ^p, I meant exactly that--a caret followed by a
lowercase p. Not Ctrl+p, but ^p, literally. That's the Find/Replace symbol
for matching a normal paragraph mark.

From what you're saying, it sounds like there are non-standard paragraph
breaks for some lines (i.e., something that doesn't match ^p) and regular
paragraph breaks for other lines.

When I said "insert a paragraph mark at the beginning," I meant simply
"press Enter", and I was assuming that your hosts file began with an ip
number, rather than with a comment (line beginning with #).

Let's try this a different way (and I assume you're working with a copy of
the hosts file):

Select all of the lines you want to change--this will let find/replace
affect only the selected lines.

Press Ctrl+H

Set Find what: to ^13 (this will match normal and non-standard paragraph
marks)

Set Replace with: to ^p127.0.0.1<5 spaces> (I.e., press the space bar 5
times)

Click Replace all.

Say No to the prompt asking if you want to apply the find/replace to the
rest of the file.

You will need to add 127.0.0.1 manually to the first item, and remove the
extraneous 127.0.0.1 at the end of the list.

Does that do it?

--

Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top