Re: Problem with Importing CSV with "=" inside a field value



Thank you for your suggestion. I've adopted your suggestion and written a
subroutine to just extract the 2 columns that I need. It's very quick, and
above all, accurate as I can control how to extract the data.

Thank you very much indeed.

Herbert

"Roger Carlson" <RogerCarlson@xxxxxxxxxxxxxxx> ¼¶¼g©ó¶l¥ó·s»D:OhmIiwfuJHA.4592@xxxxxxxxxxxxxxxxxxxxxxx
Sometimes when I have a problematic import, I will write my own import
code rather that rely on the Wizard. I use low-level IO to open the file,
read each line with the LineInput statement into a string variable, then
parse the string in code.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "ImportLineInput.mdb" which illustrates how to do this.
It's not exactly what you need, but it should get you started. You can
find the sample here:
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=340

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


"Herbert Chan" <herbert@xxxxxxxx> wrote in message
news:O0gqfqbuJHA.4980@xxxxxxxxxxxxxxxxxxxxxxx
Hello,

I have a csv file that I want to get linked into a database. I have
Microsoft Office 2007. I use Excel to open it and everything is fine. I
try using Access to link it directly. I've been tinkering with the
schema and have overcome a number of obstacles. But there is this one
that I cannot overcome.

There is a field with the following kind of value:

78HB2035801
="78792000001"
="78792090101"

For some records, it has an equal sign at the front and wrapped by
quotes. For some there is no equal sign nor quotes.

Access can process the first kind of value (without anything in front and
at the back) for the field. When it encounters the second kind (with
equal sign and quotes), access can only extract = as the value of the
field, and then the rest of the fields after this problematic field all
become blanks.

How should I treat such kind of values to enable Access to process every
fields in the record. This problematic field actually is of no use to
me. Any way to skip parsing this field such that Access can extract the
fields that I want?

Herbert






.



Relevant Pages

  • Re: Problem with Importing CSV with "=" inside a field value
    ... is a small Access database ... and have overcome a number of obstacles. ... it has an equal sign at the front and wrapped by quotes. ... Any way to skip parsing this field such that Access can extract the fields ...
    (microsoft.public.access.externaldata)
  • Re: MuPad 3.0 extraction of individual eigenvectors
    ... > way of asking MuPAD “if I wanted to extract this, ... from one command to the next I have suggested some emphasis of this in the ... I am not suggesting transforming ... I hope you find the suggestion useful. ...
    (sci.math.symbolic)
  • How to extract a tar.tar file?
    ... Pl give me the magic commands to extract the package. ... Some one has suggested me to rename the file as tar.gz and then use gunzip and tar xvf as shown below which is not foolproof. ... I just surfed and seen a suggestion to convert that tar.tar to tar.bz2 and then extract. ...
    (SunManagers)
  • Re: Trimming text box
    ... >Here's one suggestion: ... >Use the InStrRev() OR strReverse() Function to Extract ...
    (microsoft.public.access.forms)
  • Re: Importing javax.faces.context.FacesContext for Glassfish
    ... Before my posting appeared in reply to your suggestion, ... myfaces-core-1.1.5-bin.tar.gz from Apache's website, and indeed there ... a simpler approach would be just to extract the ...
    (comp.lang.java.help)

Loading