Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing Data
Hello,
I have some data in a text file that I would like to import. Unfortunately, it's not in CSV format. I was wondering if it's possible in VBA to open this file, read in a line, and parse the line as I need, and then write the line (cells) to a spreadsheet. Or should I just write a file pre-processor (which generates a CSV file) in Java, C, whatever, and import the data. I'm not a VBA expert, so I don't know the limitations. Any help would be appreciated. Regards, Alan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing Data
Yes it can be done.
Don't know your level of Basic knowledge nor what the records look like however. i.e are the records comprised of fixed length fields? If so the Text Import Wizard will allow you to parse the records without having to resort to VBA, select "Fixed Width", 2nd dialogue allows you to parse the record. If not fixed length fields and the fields have delimiters then select "Delimited", the second dialogue allows you to specify what the delimiters are. HTH -- Regards; Rob ------------------------------------------------------------------------ "Alan L. Wagoner" wrote in message ... Hello, I have some data in a text file that I would like to import. Unfortunately, it's not in CSV format. I was wondering if it's possible in VBA to open this file, read in a line, and parse the line as I need, and then write the line (cells) to a spreadsheet. Or should I just write a file pre-processor (which generates a CSV file) in Java, C, whatever, and import the data. I'm not a VBA expert, so I don't know the limitations. Any help would be appreciated. Regards, Alan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Importing Data
Rob,
My level of VBA knowledge is not that great. The file in question is generally tab delimited, but the reason I can't use the wizard is that the raw file has page number/date/time header stuff which I don't want. I'm trying to make this spreadsheet as idiot-proof as possible. Ideally, the VBA would ask the user, "Where is the file?", and they could locate it, it would get parsed, brought into Excel, and then the user could just look at the numbers. I'll have to mess with this a bit to see if it will work. Thanks for the assistance. --Alan "RWN" wrote in message ... Yes it can be done. Don't know your level of Basic knowledge nor what the records look like however. i.e are the records comprised of fixed length fields? If so the Text Import Wizard will allow you to parse the records without having to resort to VBA, select "Fixed Width", 2nd dialogue allows you to parse the record. If not fixed length fields and the fields have delimiters then select "Delimited", the second dialogue allows you to specify what the delimiters are. HTH -- Regards; Rob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Missing Cloumn data when importing external data | Excel Discussion (Misc queries) | |||
Importing:Data Connection Wizard Doesn't see Source Data - No Impo | Excel Discussion (Misc queries) | |||
Removing Data Tables formed from importing data from Access | Excel Discussion (Misc queries) | |||
Importing Data: OLE DB and data link properties dialog | Excel Discussion (Misc queries) | |||
Importing data, then adding data to the new spreadsheet.. a conund | Excel Discussion (Misc queries) |