Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2007

Tip: Looking for answers? Try searching our database.

Create DB from .txt document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sand man - 09 Aug 2007 12:52 GMT
Lname, Fname MI
City, ST
###-###-####, Pro 3
##
Lname, Fname MI
City, ST
###-###-####, Pro 2
##
Lname, Fname MI
City, ST
###-###-####, Pro 2
##
Lname, Fname MI
City, ST, Pro 3
##
Lname, Fname MI
City, ST, Pro 3

This is a sample of over 12,000 records in a txt file.  The ## is the
record separator, the ###-###-#### is the phone number.
I am trying to make a simple delimited database.

The main problem is not all records have a phone number, so I can't
just tell a macro to move down 3 lines and insert a comma.

The next problem is that the pro rating is at the end of the phone
line in some records and at the end of the city, state in other
records.  This is dependent on whether there is a phone number.

I would like to (I think) move to the third line, check if a digit 0-9
exists.
If yes, move to next record.
If no, insert a line or maybe a 111-111-1111 place holder.

Of course I still have to deal with getting the pro rating in the
proper place too.

Any help is tremendously appreciated.

Kevin
Doug Robbins - Word MVP - 09 Aug 2007 20:55 GMT
Use Edit>Replace to replace ^p with ^t and then use it again to replace
^t##^t with ^p

Each record should then be in a separate paragraph with each element of the
record separated by a tab space.

Also see "Convert Labels into Mail Merge Data File" on fellow MVP Graham
Mayor's website at:

http://www.gmayor.com/convert_labels_into_mail_merge.htm

Signature

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

> Lname, Fname MI
> City, ST
[quoted text clipped - 36 lines]
>
> Kevin
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.