Data Extraction from external source... HELP!

Thomas

Active Member
Joined
May 3, 2002
Messages
366
Ok, this one's driving me absolutely nuts:

I've been using Excel's Query wizard for some time now to do SQL-type extractions, but I'm befuddled on this one. I'm attempting to query a .csv file, but for some reason all the cells are returning as text values, even though there are either numbers or dates ~only~ in them. If I go to one of these cells, push F2, then enter, it assumes its proper numerical value. If I open the .csv file into Excel, all the number-type values are reading as they should.

Can anyone help on this? Is there a way to set up the text driver in the Data Extraction wizard to accept numerical values? I'd even settle for a macro or VBA code that activates when the data is pulled; the only issue with this is I'm pulling 45,000+ rows and up to 100 columns at a time.

PLEASE HELP!

Thanks in advance
~ Thomas
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Make a copy of your .csv file and change it's extension to .txt. Edit the file. Are your values quoted?
 
Upvote 0
I tried converting it to a .txt file, but that doesn't seem to do the trick.

The frustrating thing in this is when I look at the file that I am querying itself, all the formats are as they should be. I've done SQL extractions in the past that preserve the date/time and numerical formats as they should be, so I can't figure this one out.

I also tried importing into an Access spreadsheet; the data read in fine, but when I attempt to query it through Excel, I get the same problems.

Any other thoughts?

Thanks.
~Thomas

P.S. - FYI, what I'm doing here is creating a database in SAS, and exporting to a public directory as a .csv file. There is an auto FTP set up in the Excel workbook that automatically transfers the database from a UNIX server and posts the data into an Excel spreadsheet, then formats the date values to be read by Excel properly. Once all the auto-processing is complete, the user is allowed to query the data file.
 
Upvote 0
Probably missing the point here, but if you're using SAS, why not use PROC DBLOAD to export directly to excel- you can then control all the formatting behaviour directly....

Paddy
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top