Toby,
Thank you for your help. I finally figured out what I was doing wrong. I used a macro to run the transfer text but when I selected the transfer type I had selected delimited. I figured it was something simple that I was doing wrong but I just couldn't see where it was happening.
I just ran the macro and it looks like it is working good. I need to do some editing using what you gave me but that should be no problem.
Thank you again,
Mark
--- In AccessDevelopers@yahoogroups.com, "Toby Bierly" <toby@...> wrote:
>
> Start a manual import of a text file. As soon as you get into the wizard, hit Advanced, then hit the Specs... button, and you can pick a specification to Open. Then you can edit it and Save it again. It will prompt you for a specification name when you save, so if you want it to overwrite the old spec, make sure to use the exact same name.
>
> That specification has to be setup correctly for the text import to work properly. It needs to specify the right delimiters and the right number of fields and field types. The table that is getting imported needs to either be setup to match, or if the table does not exist, I think it will be created the first time the import runs.
>
> Hope that helps,
> Toby
>
> -----Original Message-----
> From: AccessDevelopers@yahoogroups.com [mailto:AccessDevelopers@yahoogroups.com] On Behalf Of m_bacheldor
> Sent: Tuesday, August 23, 2011 5:14 AM
> To: AccessDevelopers@yahoogroups.com
> Subject: [AccessDevelopers] Re: Importing Text files
>
>
>
> Toby,
>
> Thank you for your help. I did as you suggested but for some reason I am only importing the first group of data and that is being split into two separate fields. The way it is acting it looks like it is sperating on a space and tab for this data.
>
> Is there anyway to edit/update a saved specification? I have tried but have not found a way to get at it.
>
> Mark
>
> --- In AccessDevelopers@yahoogroups.com, "Toby Bierly" <toby@> wrote:
> >
> > Oh, I see. It reads the entire text fiile into one Variant variable and then the GoTo statement acts as the loop, with the Pos variable being incremented by 217 each time. The GoTo EndProg is what exits you out of the "loop". It is how you would do a loop with just GoTo statments. The Do Until and Loop lines are irrelevant right now, and before were getting stuck in an endless loop because the ts variable was never AtEndOfStream. So now it does work, but it just takes a long time.
> >
> > I'm not sure if dumping the entire file into one variable and then accessing that variable by position several dozen times per line is an efficient way to do it. You would have to test to see. Nomally I would bring in a .txt file using the TransferText function. You provide the function a file name, a table name, and a Specification. You get the Specification by starting a manual import. In the Database Window, on the Table tab, click New, and then choose Import Table, pick file type Text Files, it will bring up an Import Wizard, follow the steps but before you hit Finish, click on Advanced... and make sure everything looks fine there and click Save As... and type in a Specification name. This is the name you use in VBA code in the TransferText function.
> >
> > I would compare to see if that method is faster.
> >
> > Hope that helps,
> > Toby
> >
>
Please zip all files prior to uploading to Files section.
Tidak ada komentar:
Posting Komentar