By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,955 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,955 IT Pros & Developers. It's quick & easy.

Need to link a text file.

P: 1
Hi All,
This is my first time - I just would like to get some help in linking a txt file in MS access the file looks like this :-


And so on
What i need is to import them in a different 3 different fields,
XX first field Text format
061020 second field date format in (D/M/Y) currently its in (Y/M/D)
082120 third field format is in Time format 24hrs

Thanks in advance regards
Oct 28 '06 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 1,418

Use File -> Get Data -> Import or Link

In the dialog window that appears choose txt format

After that be carefull coz there is options to set...

You need to choose fixed width file and there to set your fields... It gives you also a simple. :)

I think you can also attach this kind of files like as database and when you introduce info in this table this is placed in your txt.. But never tried coz I don't believe to txt as datasource :)

Oct 28 '06 #2

P: 1
Re: Need to link a text file (and reformat).

File / Get Data / Link
Select fixed length text and click between fields to identify field separation.
Click on Advanced and the Import Specification Wizard will appear with the start positions and field lengths of your input (linked table).
Name the fields and change all data types to text. (If you plan to import additional data in this format again, you may save the specification and use it by opening the Specifications and selecting it)
Run a query to append the linked table to an empty table you have created with the fields defined in the correct sequence.

As for using the date and time in calculations and/or displaying these in their proper edited format, your receiving table must be defined with the correct data type (date/time) and one of the associated formats. Refer to Table in Design View / Data Type and Format.
Oct 29 '06 #3

Expert Mod 15k+
P: 31,342
Lots of good stuff
You can also, using the same wizard, import a text file directly into your database, which will create a new table for you.
Pay particular attention to the field type definitions when in 'Advanced' mode.
Oct 29 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.