Text find-replace

Functions, classes, components, etc. Only high quality content.

Text find-replace

Postby Silvester on Wed Aug 18, 2004 7:11 pm

Hallo Friends.

I just bought QuickMacros but I'm absolutely unable to write any code...and so I would like your precious help for two probably quiet simple macros that one day may be helpful also to others...


With the Date Ordering macro I got from Gintiras, the new data came out nicely as in the exemple below:


(Sat) 20- 1-1900 21:38 Saturn (Sag) 165° (Gem) Pluto


(Sun) 18- 2-1900 20:56 Saturn (Cap) 162° (Gem) Pluto


(Wed) 23- 5-1900 20:59 Saturn (Cap) 162° (Gem) Pluto


(Mon) 25- 6-1900 18:59 Saturn (Cap) 165° (Gem) Pluto


Anyway, I would like to reduce by half (=0.5cm instead of 1cm) the space between the lines because as they are they occupy too much space. I try to do it with Words but cannot do it through it because the line space function cuts the lines instead of formatting them properly. This due to the fact that the minimum possibility it gives me is 1cm and not less...

The second macro I would need is a macro that will check all the data in the document and eliminate doubles (or repeated) data.

Thank You very much for your kind cooperation.

Best Regards.

Silvano Tironi
Silvester
 

Postby Gintaras on Wed Aug 18, 2004 10:52 pm

That macro doesn't insert any empty lines. Try to run it again, but in another editor, eg notepad or wordpad.
____________________________________

To cut repeated lines, use QM's find-replace dialog.
Trigger Ctrl+Shift+Alt+H.

In "From" field, use

(?m)(^.+\r\n)((?s).+?)?\1

In "To" field, use

$1$2

Uncheck "Match case", "Whole word". Check "Regexp". Repeatedly click "Replace All", until third button shows 0. If doubled lines are adjacent, then you will have to click only several times, else it can take many time.
Attachments
findreplace.gif
findreplace.gif (9.28 KiB) Viewed 3972 times
Gintaras
Site Admin
 
Posts: 10412
Joined: Thu Dec 19, 2002 7:36 pm
Location: Lithuania

Postby Silvester on Thu Aug 19, 2004 7:53 am

Excellent Gintaras !

Many Thanks and have a Good Day.

Best Regards.

Silvano Tironi
Silvester
 


Return to QM Extensions

Who is online

Users browsing this forum: No registered users and 2 guests