Capturing data for comparison that's consistent yet inconsistent

S

scribe

Hi All,

Backround on me: first post (Howdy do!) and many years of computing experience. Have worked with Word macros and scripts before, but it's been a little while.

Software: MS-Word 2000

What I'm trying to do: We receive a file that is in RTF and contains account, name and address information. This file averages 65-75 pages daily. Current procedure is to print entire file, do an eyeball search for the records that don't match, and update our file with new information. There does not appear to be a way to fully automate this due to the software we are using and the capabilities of the people involved. My thought was if we can't automate the entire process, at least automate the matching process and limit the print-out to only those entries requiring action - saving time, toner and paper. The report is so long that it is usually printed out and put into a box with the idea that it will be gotten to when all the other work is done - which is not very often.

The report has headers and footers - easy part already am getting rid of those.

Each set of data to match is on two lines. The first line contains what we had for information and the second line contains 'corrected information' with the first two fields being replaced with one long tab. The tab stops on the two lines are set differently. Often their information and ours matches. These are the ones I want to get rid of. The problem is that while the information to be compared appears on the same place on the printed page, within Word there are two fields at the end of line 1 where there may be 1, both or none listed for each entry and another field often has extraneous tabs in it.

Here's the question: Is there a way to snag the pieces of info to be compared using some sort of function that relies on the ruler? For example, piece one to compare runs from point A to point B on the ruler; piece two runs from point B+1 to point C, piece three runs from point C+1 to D, and piece four runs from point D+1 to E. A, B, C, D, and E would remain constant every time this file is checked. Can I define in the program/macro what unit of measure to use to eliminate the differences in user preferences?

Any ideas?

regards,

scribe
 
H

Helmut Weber

Hi,
hm...
My I suggest to post some examples
of the lines in question?
Are you talking of lines or paragraphs?
How can these lines or paragraphs be identified?
By structure, position on page, formatting,
bookmarks, comments, key words,
number (every 6th and 7th), etc?
Are you talking of fields as VBA-objects or
just as horizontal areas of text?
What kind of font is used?
If you could use a non proportional font
like Courier you may be able to count characters
go receive a number for a horizontal position.
Are you allowed to change the text in some ways?
Maybe one could convert tabs to spaces...
There are so many possibilities...
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
H

Helmut Weber

Hi Scribe,
....interesting, so far a matter of logic rather than word programming.
Do you think you could mail me a sample file,
or at least a truly represenative part of one?
---
One first idea would be, to remove trailing ...Y.
Not a problem. Then
If "Street Address sometimes has 1 and only 1 extraneous tab" then
' (default tab-count for every 1st line of 2) = 5,
if tabs-count > 5 then remove tab 3. The tab in street address.
After that, every first line must have 5 Tabs.
Every 2nd line has 4 tabs anyway.
Then, what has to be compared is the text between
line(1),tab 2, tab 3 and line(2), tab 1, tab 2;
line(1),tab 3, tab 4 and line(2), tab 2, tab 3;
line(1),tab 4, tab 5 and line(2), tab 3, tab 4;
line(1),tab 5, Paragraph and line(2), tab 4, Paragraph.
Seems to get systematic, right?
Or replace the 1st tab in every second line by two tabs.
Then the items to becompared would be, if in a table,
in vertically adjacent cells. Though there is no need of tables.
Should work if the doc was produced by a well programmed program.
If it was produced by humans, then it's hopeless.
 

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