ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I remove quotation marks from .CSV file (https://www.excelbanter.com/excel-programming/332614-how-do-i-remove-quotation-marks-csv-file.html)

Ratty

how do I remove quotation marks from .CSV file
 
I'm using Excel VBA to load values from worksheet cells and then writing
these to a .csv file. My problem is that when the CSV is viewed in
NOtepad/wordpad, the text field value are enclosed in quotation marks ".

When I first did this they were'nt and I can't think what's changed. Also
not all text fields appear to have had quotation marks

I've tried applying different fomatting on the sheet and saving as .txt
rather than .csv but no difference

I need to send the file to a guy whose loader can't cope with quotation
marks but frankly for the moment I'm stumped.

Any ideas?

ps the file open line is :
Open file_path For Append Access Write As #1

Cheers

DM Unseen

how do I remove quotation marks from .CSV file
 
Ratty,

use Activesheet.SaveAs("mytextfile.csv",xlCSV)

there are a lot of supported exportformats(see help for al supported
formats), no need to write this yourself!

DM Unseen


Jim Rech

how do I remove quotation marks from .CSV file
 
Excel uses quotes where necessary for clarity in saving CSV files. For
instance, if a cell contains a comma or a quote, quotes would be necessary.
If you have a comma in a cell then without quotes any "loader" program would
get it wrong wouldn't it?

I think you have to find all the characters in your data that triggers Excel
adding quotes and eliminate them.

--
Jim
"Ratty" wrote in message
...
| I'm using Excel VBA to load values from worksheet cells and then writing
| these to a .csv file. My problem is that when the CSV is viewed in
| NOtepad/wordpad, the text field value are enclosed in quotation marks ".
|
| When I first did this they were'nt and I can't think what's changed. Also
| not all text fields appear to have had quotation marks
|
| I've tried applying different fomatting on the sheet and saving as .txt
| rather than .csv but no difference
|
| I need to send the file to a guy whose loader can't cope with quotation
| marks but frankly for the moment I'm stumped.
|
| Any ideas?
|
| ps the file open line is :
| Open file_path For Append Access Write As #1
|
| Cheers




All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com