#1   Report Post  
Jgrant Jgrant is offline
Junior Member
 
Posts: 2
Default Quick way to format this?

I have a document that is around 50,000 lines long, and I want to turn it into an organized thing people can read. This is the format it is in at the moment:
Code:
over.push([true,'Floating Devil', ,shop[8],0,mi[21],option[1],false]);
over.push([true,'Floating Angel', ,shop[8],0,mi[20],option[1],false]);
over.push([true,'Floating Devil 2', ,shop[8],0, mi[21],option[1],false]);
over.push([true,'Floating Angel 2', ,shop[8],0, mi[20],option[1],false]);
over.push([true,'Notes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Heartsurroundings', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Valentine Bubble', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Flying Bats', ,shop[8],0,mi[3],option[1], true]);
over.push([true,'Fire Phoenix Flames', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Water Phoenix Flames', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Wind Leaves', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Snowflakes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Night Stars', ,shop[0],700,mi[0],option[0], true]);
I want any lines that don't have mi[0] in them erased, and I want the ones that do contain mi[0] changed into this sort of format:
Notes - shop[2] - 450
Wind Leaves - shop[2] - 450
Snowflakes - shop[2] - 450
Night Stars - shop[0] - 700

Would there be any faster way of doing this (Using find and replace? I can't figure out how to do it right, with wildcards and all,) than doing it manually?

I have tried, but everytime I try to use wildcards I mess it up. Any step-by-steps?


The work is for a website I am working on. I wont say the specifics, but I made a spider that collected the data, but it could only churn it out in the first format. I need to make it into the second so my viewers would be capable of reading it.
  #2   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Doug Robbins Doug Robbins is offline
external usenet poster
 
Posts: 17
Default Quick way to format this?

Use a macro containing the following code:

Dim i As Long
With ActiveDocument
For i = .Paragraphs.Count To 1 Step -1
If InStr(.Paragraphs(i).Range.Text, "mi[0]") = 0 Then
.Paragraphs(i).Range.Delete
Else
With .Paragraphs(i).Range
.Text = Mid(.Text, InStr(.Text, "true") + 6)
.Text = Left(.Text, InStr(.Text, ",mi[0]") - 1) & vbCr
.Text = Replace(.Text, "', ,", " - ")
.Text = Replace(.Text, ",", " - ")
End With
End If
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Jgrant" wrote in message
...

I have a document that is around 50,000 lines long, and I want to turn
it into an organized thing people can read. This is the format it is in
at the moment:
Code:
--------------------

over.push([true,'Floating Devil', ,shop[8],0,mi[21],option[1],false]);
over.push([true,'Floating Angel', ,shop[8],0,mi[20],option[1],false]);
over.push([true,'Floating Devil 2', ,shop[8],0, mi[21],option[1],false]);
over.push([true,'Floating Angel 2', ,shop[8],0, mi[20],option[1],false]);
over.push([true,'Notes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Heartsurroundings', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Valentine Bubble', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Flying Bats', ,shop[8],0,mi[3],option[1], true]);
over.push([true,'Fire Phoenix Flames', ,shop[2],450,mi[0],option[0],
true]);
over.push([true,'Water Phoenix Flames', ,shop[2],450,mi[0],option[0],
true]);
over.push([true,'Wind Leaves', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Snowflakes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Night Stars', ,shop[0],700,mi[0],option[0], true]);

--------------------

I want any lines that don't have mi[0] in them erased, and I want the
ones that do contain mi[0] changed into this sort of format:
Notes - shop[2] - 450
Wind Leaves - shop[2] - 450
Snowflakes - shop[2] - 450
Night Stars - shop[0] - 700

Would there be any faster way of doing this (Using find and replace? I
can't figure out how to do it right, with wildcards and all,) than
doing it manually?

I have tried, but everytime I try to use wildcards I mess it up. Any
step-by-steps?


The work is for a website I am working on. I wont say the specifics,
but I made a spider that collected the data, but it could only churn it
out in the first format. I need to make it into the second so my viewers
would be capable of reading it.




--
Jgrant



  #3   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Doug Robbins Doug Robbins is offline
external usenet poster
 
Posts: 17
Default Quick way to format this?


Use a macro containing the following code:

Dim i As Long
With ActiveDocument
For i = .Paragraphs.Count To 1 Step -1
If InStr(.Paragraphs(i).Range.Text, "mi[0]") = 0 Then
.Paragraphs(i).Range.Delete
Else
With .Paragraphs(i).Range
.Text = Mid(.Text, InStr(.Text, "true") + 6)
.Text = Left(.Text, InStr(.Text, ",mi[0]") - 1) & vbCr
.Text = Replace(.Text, "', ,", " - ")
.Text = Replace(.Text, ",", " - ")
End With
End If
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Jgrant" wrote in message
...

I have a document that is around 50,000 lines long, and I want to turn
it into an organized thing people can read. This is the format it is in
at the moment:
Code:
--------------------

over.push([true,'Floating Devil', ,shop[8],0,mi[21],option[1],false]);
over.push([true,'Floating Angel', ,shop[8],0,mi[20],option[1],false]);
over.push([true,'Floating Devil 2', ,shop[8],0, mi[21],option[1],false]);
over.push([true,'Floating Angel 2', ,shop[8],0, mi[20],option[1],false]);
over.push([true,'Notes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Heartsurroundings', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Valentine Bubble', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Flying Bats', ,shop[8],0,mi[3],option[1], true]);
over.push([true,'Fire Phoenix Flames', ,shop[2],450,mi[0],option[0],
true]);
over.push([true,'Water Phoenix Flames', ,shop[2],450,mi[0],option[0],
true]);
over.push([true,'Wind Leaves', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Snowflakes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Night Stars', ,shop[0],700,mi[0],option[0], true]);

--------------------

I want any lines that don't have mi[0] in them erased, and I want the
ones that do contain mi[0] changed into this sort of format:
Notes - shop[2] - 450
Wind Leaves - shop[2] - 450
Snowflakes - shop[2] - 450
Night Stars - shop[0] - 700

Would there be any faster way of doing this (Using find and replace? I
can't figure out how to do it right, with wildcards and all,) than
doing it manually?

I have tried, but everytime I try to use wildcards I mess it up. Any
step-by-steps?


The work is for a website I am working on. I wont say the specifics,
but I made a spider that collected the data, but it could only churn it
out in the first format. I need to make it into the second so my viewers
would be capable of reading it.




--
Jgrant



  #4   Report Post  
Jgrant Jgrant is offline
Junior Member
 
Posts: 2
Default

Sorry for the absense. Life caught up with me for a bit.

Thank you so much for the macro. I have another question:

Would you happen to know a way that I could get it to take all the lines that contain shop[1], and group all them together. Then I can repeat that for shop[2], shop[3], etc, and have them all grouped that way?

I've been doing it manually, and it's a pain.

Quote:
Originally Posted by Doug Robbins View Post
Use a macro containing the following code:

Dim i As Long
With ActiveDocument
For i = .Paragraphs.Count To 1 Step -1
If InStr(.Paragraphs(i).Range.Text, "mi[0]") = 0 Then
.Paragraphs(i).Range.Delete
Else
With .Paragraphs(i).Range
.Text = Mid(.Text, InStr(.Text, "true") + 6)
.Text = Left(.Text, InStr(.Text, ",mi[0]") - 1) & vbCr
.Text = Replace(.Text, "', ,", " - ")
.Text = Replace(.Text, ",", " - ")
End With
End If
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Jgrant" wrote in message
...

I have a document that is around 50,000 lines long, and I want to turn
it into an organized thing people can read. This is the format it is in
at the moment:
Code:
--------------------

over.push([true,'Floating Devil', ,shop[8],0,mi[21],option[1],false]);
over.push([true,'Floating Angel', ,shop[8],0,mi[20],option[1],false]);
over.push([true,'Floating Devil 2', ,shop[8],0, mi[21],option[1],false]);
over.push([true,'Floating Angel 2', ,shop[8],0, mi[20],option[1],false]);
over.push([true,'Notes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Heartsurroundings', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Valentine Bubble', ,shop[8],0,mi[13],option[1], true]);
over.push([true,'Flying Bats', ,shop[8],0,mi[3],option[1], true]);
over.push([true,'Fire Phoenix Flames', ,shop[2],450,mi[0],option[0],
true]);
over.push([true,'Water Phoenix Flames', ,shop[2],450,mi[0],option[0],
true]);
over.push([true,'Wind Leaves', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Snowflakes', ,shop[2],450,mi[0],option[0], true]);
over.push([true,'Night Stars', ,shop[0],700,mi[0],option[0], true]);

--------------------

I want any lines that don't have mi[0] in them erased, and I want the
ones that do contain mi[0] changed into this sort of format:
Notes - shop[2] - 450
Wind Leaves - shop[2] - 450
Snowflakes - shop[2] - 450
Night Stars - shop[0] - 700

Would there be any faster way of doing this (Using find and replace? I
can't figure out how to do it right, with wildcards and all,) than
doing it manually?

I have tried, but everytime I try to use wildcards I mess it up. Any
step-by-steps?


The work is for a website I am working on. I wont say the specifics,
but I made a spider that collected the data, but it could only churn it
out in the first format. I need to make it into the second so my viewers
would be capable of reading it.




--
Jgrant
  #5   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Pamelia Caswell via OfficeKB.com Pamelia Caswell via OfficeKB.com is offline
external usenet poster
 
Posts: 468
Default Quick way to format this?

This works in W2007:

Select the whole list. Click sort Options. Select the "Other" radio button
and enter a hyphen in the box.
Back in the Sort Text dialog, set the sort by to "Field 2"and click OK.

If that won't work with your version , this longer method should:Temporarily
replace the hyphens with tabs (^t). Convert the tabbed list to a three-
column table. Sort the table on the second column. Then convert the table
back to a tabbed list and replace the tabs with hyphens.

Pam

Jgrant wrote:
Sorry for the absense. Life caught up with me for a bit.

Thank you so much for the macro. I have another question:

Would you happen to know a way that I could get it to take all th
lines that contain shop[1], and group all them together. Then I ca
repeat that for shop[2], shop[3], etc, and have them all grouped tha
way?

I've been doing it manually, and it's a pain.

Doug Robbins;431429 Wrote:
Use a macro containing the following code:

[quoted text clipped - 69 lines]
viewers
would be capable of reading it.


--
Jgrant


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...gdocs/200909/1



  #6   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Pamelia Caswell via OfficeKB.com Pamelia Caswell via OfficeKB.com is offline
external usenet poster
 
Posts: 468
Default Quick way to format this?

This works in W2007:

Select the whole list. Click sort Options. Select the "Other" radio button
and enter a hyphen in the box.
Back in the Sort Text dialog, set the sort by to "Field 2"and click OK.

If that won't work with your version , this longer method should:Temporarily
replace the hyphens with tabs (^t). Convert the tabbed list to a three-
column table. Sort the table on the second column. Then convert the table
back to a tabbed list and replace the tabs with hyphens.

Pam

Jgrant wrote:
Sorry for the absense. Life caught up with me for a bit.

Thank you so much for the macro. I have another question:

Would you happen to know a way that I could get it to take all th
lines that contain shop[1], and group all them together. Then I ca
repeat that for shop[2], shop[3], etc, and have them all grouped tha
way?

I've been doing it manually, and it's a pain.

Doug Robbins;431429 Wrote:
Use a macro containing the following code:

[quoted text clipped - 69 lines]
viewers
would be capable of reading it.


--
Jgrant


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...gdocs/200909/1

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a Quick way to format multiline sentences to one sentence? Goldenmaster Microsoft Word Help 1 March 22nd 09 03:00 AM
Quick Words JERRY[_2_] New Users 6 October 17th 07 09:24 PM
quick question Morgan Microsoft Word Help 4 June 15th 07 06:42 AM
Quick reference Dorian Page Layout 1 January 16th 06 07:45 PM
Quick Question Me Microsoft Word Help 1 December 9th 05 06:37 PM


All times are GMT +1. The time now is 03:01 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"