editing txt before import

cesarelias

New member
Local time
Today, 08:49
Joined
May 10, 2009
Messages
8
I've got a txt file I want to import using the Docmd.importtext
but I first need to delete the following text string '+'and '-'.
If I do this manually i can get it to work but I need to do it from VBA.
I need to alter the text file into and then save it.
the txt file
014145cesar855858elias+canaisocos-casticalordemnolocal-8585889
014146cesar855859elias+canaisocos-ordemnolocal-8585889
014147cesar855860eliasferiado+canaisocos-ordemnolocal-8585889
014148cesar855861eelias+canaisocos-ordemnolocal-8585889

Thank you very much,
cesarelias
 
Howzit

WELCOME TO THE FORUM CESARELIAS

I'm not sure how to do this from within the text file.
What I would do, if I couldn't find a way to do it from within the text file is:
  • Import file into a staging table
  • Create 2 update queries, using the Replace function to remove the two symbols replacing with a ""
  • perform any other data updates required
  • Then append the data to your main table(s), specifying the order that you want
 
Last edited:
kiwiman, thank your help

I do not manage to import because "+" it is not recognized in the access.
When I import it appears "???????" instead of "+"
would you know how you will import in the symbols "+" e "-" without appearing "?????"
at their place?

I annexed the archive with the wrong that is appearing


thank cesarelias
 

Attachments

Howzit

Try this

Create a new import spec and when you click advanced, change the code page section to US_ASCII.

I just tried it on mine using your source and it came through as

014145cesar855858elias+canaisocos-casticalordemnolocal-8585889
014146cesar855859elias+canaisocos-ordemnolocal-8585889
014147cesar855860eliasferiado+canaisocos-ordemnolocal-8585889
014148cesar855861eelias+canaisocos-ordemnolocal-8585889
 
Kiwiman, thank you for your reply.
I managed to import using the "us-ascii"
thank you very much.
Cesarelias
 

Users who are viewing this thread

Back
Top Bottom