Re: Removing quotes from a csv file after DoCmd.TransferText

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you want to create a CSV file without quotes around the field values, use
an export specification. Export the table once manually and tell the wizard
to use no "qualifier" (instead of the default quote marks). Then click the
Advanced button in the wizard and save the specification under a convenient
name.

Subsequently, pass the name of the specificatoin as an argument to
TransferText.

Remember that,if you don't use quote marks in the CSV file you must ensure
that there are no commas in the data.

To remove quote marks from an existing CSV file, use the Replace command of
Notepad or any other text editor. Or if Perl is installed on your machine,
you can use this command:

perl -i.bak -pe"s/\x22//g" "myfile.csv"


"thrashin via AccessMonster.com" <u21899@uwe> wrote in message
news:61804bd10b6c9@xxxxxx
Hello. I have seen this topic covered here but it was two years ago. I
built a database in Access 2003. When the user clicks a command button,
the
click event procedure runs/exports a table data to a csv via the acdelim
method. DoCmd.TransferText, acDelim, etc etc

When the file comes out onto my hard drive, I open it with Notepad. I see
quotes surrounding fields that have text in them. I want to remove the
quotes entirely from the csv output file. I currently can do this with
making a report first of the table data that I want to see (no page header
no
page footer) than

DoCmd.OutputTo, acReport, (I forgot what I put after this) but, there is a
lot of space around the entries so then, I thought I would play with the
field widths of the report and put , label controls in between the fields
to
make the TXT file look like a csv. That seems like a lot of work.

Isn't there a more preferred method to remove the quotes from a csv file
with
a global find all " and strip all ". Would a Trim or Left, Mid, Right do
the
trick? I just am forgetting the syntax.

Anotherwords, I could run the export as is since it works although I get
quotes in the output. But, I could programmatically with code open the
file
on my hard drive and remove the quotes?

Sorry for the long windedness but, I have been scratching my head for
three
days on this one?

Thank you

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-externaldata/200606/1


.



Relevant Pages

  • RE: Double quotes within text cause unparsable record error
    ... I was thinking about replacing the quotes. ... challenge is that I don't know in what format or configuration the quotes may ... "Jerry Whittle" wrote: ... The overall goal is to import 480K records into a table from a CSV file. ...
    (microsoft.public.access.externaldata)
  • Re: Basic Program to Import a CSV file
    ... With the risk of sounding like Tom, I'll mention that I use OpenOffice, but I could just save my OO spreaadsheets as Excel files before using ExcelExport. ... ExcelExport ensures that all fields are wrapped in quotes, ... shows fields are delimited by commas. ... Each row of the CSV file would be a record in the deals.mv file, ...
    (comp.databases.pick)
  • Re: Your opinion please, embedded commas in CSV files
    ... A colleague is developing an import routine that reads data from a CSV file and writes it ... out to the database. ... started to contain some text fields with quotes around them and embedded commas. ... handle the case when the text field is enclosed in quotes and has an embedded comma. ...
    (microsoft.public.vb.general.discussion)
  • Re: csv data file, but with a twist
    ... A "real" CSV file would have had quotes around that field, so this is, ... but luckily the 3rd field always has the format XXXX.XX (four digits, ... print join ",", @l; ...
    (comp.lang.perl.misc)
  • Re: Moving contacts from Outlook 03 to Entourage 08
    ... except much of everything has quotes around ... and this causes me a lot of headaches. ... Entourage can import a .csv file. ... Just select the option in Outlook to ...
    (microsoft.public.mac.office.entourage)