View Single Post
 
Old 06-16-2012, 12:01 AM
donlincolnmsof donlincolnmsof is offline Windows 7 64bit Office 2003
Advanced Beginner
 
Join Date: Oct 2011
Posts: 36
donlincolnmsof is on a distinguished road
Smile

Hello Paul

Thanks for replying back to me.

Below is my response



In your latest post you have numerous references to 'beginning code=abc' and 'ending code=xyz'. What are the actual codes? Does the same phone number appear with more than one kind of 'bunch of data' and, if so, what is to be done in such cases?

The beginning code is FirstN and the ending code is LastN

Between the begin code and end code there are other items and those change all the time
like address, ss#, dob, phone number, place of business

so the line record looks something like this.

FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith.

And then there is bunch of garbage data, af;adkfjakfjadfjadfjdfasdfadfasdfadfsdfdsfdfdsafad safasfdfs

Then the records begins again in the garbage data, as the above sequence.


So data looks something like this.

Sffsaffafa afadfadfasdfadf adfafdadfasdfdsfsaf sdfadfsdf FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith. Sfdfsdfsaf fadfasdfsfsffa sdfasdfasdfsadf fsadfadsfasdf sdfadfasf FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith. Dfsdfsfadfasfa afsadfd asdfasdfas sfdafdaf sdfsdfsfa sfdfsfdsf FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith. Asfasfsfdfsfa sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf sfsfdfsfs sfdfsfdsfs FirstN=Dave, address=345 xyz street, ss#=444-44-444, dob=09-08-2008, phone=908-555-1212, place of business=abczey co, LastN=Bartel. Sdfsdfdsf sdfadfafkjl a fafjdfajd;fk; asdff sdfsddfsdf sfdfsfdsf

so as you can see from the above data, I need to pull the record out of this data

a record is considred

FirstN=john, address=123 xyz street, ss#=555-55-5555, dob=09-09-2009, phone=916-555-1212, place of business=abc co, LastN=smith.

and it’s a TEXT file with continuous data, one thing is good that the once the 1st number is found the duplicate number and next few duplicate numbers appears right in the flow of the file like in the above data and they don’t appear anywhere else in the file.

Does the same phone number appear with more than one kind of 'bunch of data' and, if so, what is to be done in such cases?

No the bunch of data and phone numbers are always same, so I only need to extract one time and if the next number is duplicate then the macro should skip it, since deleting will take too much time for the file to adjust upward.


It's not apparent what your use of:

Code:
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtendis for.

It doesn't seem to have any logical connection with the data you've posted. Perhaps you could explain this.

Yeah you can ignore the code that I posted, I’m using windows 7 and word 2003, ( forgot to mentioned that earlier) but don’t need the above code. I used word 2003 macro record functions to record the macro keystrokes.

If you can extract the data that I mentioned some how then that’s all I need.



Finally, you refer to 'take out that whole record into a new window'. I take it you mean another document. Is this a new document or an existing document that you need the content pasted into?

Just a new document window and switching back and forth to extract the data from the main window and then put in the other window.


PS: When posting code, please use the code tags - they're on the 'Advanced' screen.
I will try, not too familiar with the system.


I will really appreciate all your help

Thanks.!!
Reply With Quote