Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting VaLues to Field Names

Status
Not open for further replies.

czarjosh

Technical User
Jul 14, 2002
79
US
i was given a very big txt file, that when i put into access is a complete mess. Though there are about 300000 records, i have identified in one of the field 163 unique values. I assume these are field names. I was wondering how i can make a table otu of these 163 unique values, so that i some can begin making sense of this data
 
00000000002207",= Report_ID
"MA01013308", = Value
1, = Field_Number
"CERT1a", = Field_ID
"Facility ID" = Report_Label

The example that i ahve post is one set of this data. In teh big text file it is the excel report that you see (only CSV) but lumps them all together, so the next report starts again. all lumped into one giant file. The who text file is 139 megs.
 
Are you suggesting that the entire 1309 "records" are all the same Report_ID?

I imported the Excel file into Access and named the table "tblSample". I renamed the fields to Data, Seq, SLC, and Description. Then to "transform" all the records with an SLC beginning with "A", I used the following SQL:

TRANSFORM First(tblSample.Data) AS FirstOfData
SELECT 1 AS ID
FROM tblSample
WHERE (((tblSample.SLC) Like "A*"))
GROUP BY 1
PIVOT tblSample.SLC;

This results in something like:
Code:
ID   A1aA   A1aB   A1aC   A1baA   A1baB   A1baC   A1baD   A1bbA   A1bbB
1    727    0      727    0       0       0       	    0


Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top