Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
RWN RWN is offline
external usenet poster
 
Posts: 104
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Cloumn data when importing external data Findus Excel Discussion (Misc queries) 0 December 16th 08 11:22 AM
Importing:Data Connection Wizard Doesn't see Source Data - No Impo Exotic Hadron Excel Discussion (Misc queries) 0 October 1st 08 07:35 PM
Removing Data Tables formed from importing data from Access Andrea Jones Excel Discussion (Misc queries) 0 April 10th 08 12:01 PM
Importing Data: OLE DB and data link properties dialog Vivek Excel Discussion (Misc queries) 0 October 22nd 07 03:59 PM
Importing data, then adding data to the new spreadsheet.. a conund AndyL82 Excel Discussion (Misc queries) 1 March 9th 06 10:05 PM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"