Import a txt file with text fields that have meaningful leading sp

M

Muehe

I am using the import text file in excel 2007 and it is acting different than
it did in excel 2003
i have a text field that can have leading spaces --the spaces are menaingfull.
In 2003, setting the field to text on the import preseved the leading spaces
-- not so with 2007. It left justifies the field.
Just wondering if there is an option that i can set? Or some different
method of doing it.
 
J

Jim Rech

I didn't have that problem in Excel 2007. I tried several things because
you didn't post an example. Here's one:

123," abc", 123,456

Here I specified a comma delimiter and the third field as text. Both the
second and third fields had their leading spaces preserved in Excel 2007.
The first and fourth came in as numbers. In another example I removed the
quotes around the second field and the leading spaces were again preserved.

--
Jim
|I am using the import text file in excel 2007 and it is acting different
than
| it did in excel 2003
| i have a text field that can have leading spaces --the spaces are
menaingfull.
| In 2003, setting the field to text on the import preseved the leading
spaces
| -- not so with 2007. It left justifies the field.
| Just wondering if there is an option that i can set? Or some different
| method of doing it.
 
M

Muehe

A little more clarification on the problem
It is a fixed length text file -- let assum 10 chars per field, 2 fields
123456789|1234567890|
Muehe ABC
Muehe ABC

I mark off the fields, i specify that both are text fields (not general)
The second fields are not equal because of the leading spaces -- excel 2007
did not preserve the spaces. Doing the same process in excel 2003, worked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top