Re: Importing Text File that is vertically oriented



Hi George,

There's no direct way of doing this.

If you just want to look up values of the fields in your one-record
file, set it up as a linked table with two |-separated fields (let's
call them FieldName and Value). You can then use DLookup() to look up
the Value corresponding to any FieldName.

If you have to get the fields arranged "horizontally" so you can join
this one-record "table" with other tables, the following will work:

1) Set up linked table as above. I'll call it tblVertical

2) Create a query on the table that returns both fields and a dummy
"Row" field:
SELECT 1 AS Row, FieldName, Value FROM tblVertical;

3) Use that query as the source for a crosstab query that uses Row for
row heading, FieldName for column headings, and First(Value) for the
tabulation (and no row totals).

4) This query returns the fields and values "horizontally", ready for
use in other queries.



On 31 Dec 2005 07:20:18 -0800, ghadley_00@xxxxxxxxx wrote:

>Hi,
>
>I have a MS access database into which I need to import a text file
>that is oriented vertically (fields are listed from top to bottom with
>the value for each field appearing to the right of the field name (with
>a "|" as a delimiter)). The text file will only have 1 record's data.
>I would ideally like to setup a linked table to import this data - does
>anyone know of a way I can setup this import?
>
>Any help that can be provided would be greatly appreciated.
>
>Best wishes,
>
>George Hadley
>ghadley_00@xxxxxxxxx
>

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

.



Relevant Pages

  • Re: Help! Keep getting duplicate page
    ... How do I setup my report so ... Try running the Query that is the RecordSource of the Report to make sure ... Microsoft Access MVP ...
    (microsoft.public.access.reports)
  • RE: Tables and Forms
    ... Dave Hargis, Microsoft Access MVP ... record source of my form to go to the query. ... You will see the name of the table in the Record Source property. ...
    (microsoft.public.access.gettingstarted)
  • RE: Tables and Forms
    ... If I want to run a query on just the data that we DON'T have in our files ... Dave Hargis, Microsoft Access MVP ... You will see the name of the table in the Record Source property. ...
    (microsoft.public.access.gettingstarted)
  • Re: Excel Calcs in Access
    ... Import it from an excel spreadsheet into a table. ... "John Nurick" wrote: ... below is the result of the same query but 1 line above. ... John Nurick [Microsoft Access MVP] ...
    (microsoft.public.access.modulesdaovba)
  • RE: Tables and Forms
    ... Dave Hargis, Microsoft Access MVP ... I want to run a query on just the one's ... You will see the name of the table in the Record Source property. ...
    (microsoft.public.access.gettingstarted)