A
Alan
Hi All,
I have to import CSV files into excel.
A regular issue with this is that often the CSV files will contain
data (in this case account codes) that excel interprets as dates (such
as '3-8000' being converted to 1 Mar 8000).
Nothing unusual so far, in that we handle that issue by importing
manually (External Data - Text import), and specifying that the field
in question is imported as TEXT not GENERAL.
However, I have a file that, when I double click on it, it opens up
perfectly (except with dates where it should be text as outlined
above), but if I manually import that file, it then chokes on some
control characters that are in the CSV file (specifically an ASCII
Code 13 which is a carriage return).
I haven't got much of a clue on what the best way to go from here
would be, so looking for any suggestions.
One possible idea that is probably a VBA solution (happy to go down
that track if easiest) is to somehow do a search and replace on the
source CSV file and convert the CRs (ASCII 13) to, say, spaces (ASCII
32). I think I'd need to do that to the external CSV file though
before it got imported, hence the VBA requirement?
Thanks in advance for any ideas.
--
Alan.
The views expressed are my own, and not those of my employer or anyone
else associated with me.
My current valid email address is:
(e-mail address removed)
This is valid as is. It is not munged, or altered at all.
It will be valid for AT LEAST one month from the date of this post.
If you are trying to contact me after that time,
it MAY still be valid, but may also have been
deactivated due to spam. If so, and you want
to contact me by email, try searching for a
more recent post by me to find my current
email address.
The following is a (probably!) totally unique
and meaningless string of characters that you
can use to find posts by me in a search engine:
ewygchvboocno43vb674b6nq46tvb
I have to import CSV files into excel.
A regular issue with this is that often the CSV files will contain
data (in this case account codes) that excel interprets as dates (such
as '3-8000' being converted to 1 Mar 8000).
Nothing unusual so far, in that we handle that issue by importing
manually (External Data - Text import), and specifying that the field
in question is imported as TEXT not GENERAL.
However, I have a file that, when I double click on it, it opens up
perfectly (except with dates where it should be text as outlined
above), but if I manually import that file, it then chokes on some
control characters that are in the CSV file (specifically an ASCII
Code 13 which is a carriage return).
I haven't got much of a clue on what the best way to go from here
would be, so looking for any suggestions.
One possible idea that is probably a VBA solution (happy to go down
that track if easiest) is to somehow do a search and replace on the
source CSV file and convert the CRs (ASCII 13) to, say, spaces (ASCII
32). I think I'd need to do that to the external CSV file though
before it got imported, hence the VBA requirement?
Thanks in advance for any ideas.
--
Alan.
The views expressed are my own, and not those of my employer or anyone
else associated with me.
My current valid email address is:
(e-mail address removed)
This is valid as is. It is not munged, or altered at all.
It will be valid for AT LEAST one month from the date of this post.
If you are trying to contact me after that time,
it MAY still be valid, but may also have been
deactivated due to spam. If so, and you want
to contact me by email, try searching for a
more recent post by me to find my current
email address.
The following is a (probably!) totally unique
and meaningless string of characters that you
can use to find posts by me in a search engine:
ewygchvboocno43vb674b6nq46tvb