EXCEL read a text string as scientific notation
Dave - close but no cigar. I am not trying to read in the text into a csv
file, I am creating the csv file for a downstream app. The app is either
using EXCEL or other Office product, and is blowing up on the one data
element. I want the CSV file formated by EXCEL so that it understands not to
try to interpret the data.
Thanks for taking the time to post...
Chuck
"Dave O" wrote:
Hey, Chuck-
This will work, up to a point and after a fashion (or at least until
one of the gurus responds with a better idea): change your CSV file
extension to TXT, and follow the wizard to import the file. When it
comes time to choose a format type, change "General" to "Text" for
columns that contain the E within the text string. This VBA command
worked with the sample data you included in your post (i.e., three
columns of data):
Workbooks.OpenText Filename:="C:\ok2del.txt", Origin:=437,
StartRow:=1, _
DataType:=xlDelimited, TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter _
:=False, Tab:=False, Semicolon:=False, Comma:=True,
Space:=False, _
Other:=False, FieldInfo:=Array(Array(1, 2), Array(2, 2),
Array(3, 2)), _
TrailingMinusNumbers:=True
The only other idea I can think of is to write VBA code that will open
the CSV file, read each line, and write to cells while formatting E
entries as text. That's chunky but do-able, it just may be more than
the time is worth.
Dave O
Eschew obfuscation
|