View Full Version : Field splitting...has different separators


Mike375
04-11-2008, 08:02 PM
I have been able to do this with a work around but it is slow and cumbersone when lots of records are involved and am hoping there is a "proper way" to edo it.

--(&100,,,, 200 ---() 300,400- (500),,,, --600

6 is the maximum number of alpha/number entities and down to ----john etc. Result to be

100 200 300 400 500 600

There can also be a mixture as in

--(&John,,,, 200 ---() Andrews,400- (500),,,, --600

John 200 Andrews 400 500 600

Uncle Gizmo
04-11-2008, 10:40 PM
I've done similar things a few times, basically you need to check the characters ascii value against a list of rejected characters, however you also need to flag that the previous character was good, so when you have a rejected character following a good character you need to know its position because this will now become your delimiter.

Uncle Gizmo
04-11-2008, 10:49 PM
I believe this question has been examined within the forum before I have done a quick search using Google advanced hopefully you can see the results (http://www.google.co.uk/search?hl=en&safe=off&as_qdr=all&q=ascii+site%3Awww.access-programmers.co.uk%2Fforums+replace&btnG=Search&meta=)here:

Mike375
04-13-2008, 10:11 PM
i had a look at several searches but the only thing I could see that was close involved looping through.

pkstormy
04-13-2008, 10:56 PM
Here's a nice little program I made which let's you import certain key words after certain characters (which you specify) into tables. For example, the phrase:

The #: 22343 over %123.

Can be setup so that you import everything after the #: and % into designated fields so that field1 will then contain 22343 and field2 will contain 123.

All you need to do is tell it what characters you want it to recognize (which you simply add to a table.) You may want to rename the fields it imports to but I think you'll find this does what you want it to do.

It's designed to import files with a mass amount of records, searching through the field(s) for the key words and then saving the values after those keywords into other fields in a different table (basically breaking apart strings).

I made it as generic as possible to handle any kind of situation and data to import. I hope you find it useful. If you can't use the whole app, you might find some good ideas for your code.

Either way, please let me know.

Mike375
04-13-2008, 11:19 PM
i just had a quick look. Not sure how to work it but it looks like it could find fly shit in pepper:D

When you say "Here's a nice little program I made which let's you import certain key words after certain characters (which you specify) into tables."

Is that a problem if the field had phone numbers, date etc. That is, if there are 5000 records there will be 5000 different phone numbers.