double quotes when saving to a text file

Gaijin

Board Regular
Joined
Jul 21, 2002
Messages
56
I searched the boards but i could not find an answer to what I am sure is a simple solution to a vexing problem. When I save my execl sheet into a text format then open it in notepad or wordpad it puts quotes around the data.

I am using the data to insert into Oracle databases and therefore the double quotes must be taken out. In the notepad/wordpad I can do a find and replace but it can be time consuming when you have a large number of rows. Does anyone know how to get rid of the quotes?

Gaijin
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I think it has to do with the text format you are saving it to. If you are saving to a comma separated text file, I think it will put in the double quotes to differentiate actual commas (like in names) with the separators.

I believe if you save it to a different text option, like fixed width text, it might not insert the quotes.

If you need the commas, one workaround is to "build" the text string on a different sheet in just one column, inserting commas between your fields, and then saving as a fixed width text file.
 
Upvote 0
I have done this before, but I can't remember off-hand what setting you need to use. Could you post the relevant part of your code here? This will minimise the time required to provide the fix for you.

Thanks
 
Upvote 0
Another option is if you have a good text editor, like Ultra Edit, you can do a Search and Replace on the text file, replacing the quotes with nothing.
 
Upvote 0
Insert into Orders (ord_id, name, order_amt) values ('10','Name','order_amt');

There is an example of the statement in A1, but when you save it as any of the txt file formats it puts quotes around each cell

Thank you for your help

Gaijin
 
Upvote 0
OK, I thought you were using VBA to accomplish this. There are some tricky settings that can throw things off there. Anyway, the simple solution is to save your file as a "Formatted Text (space delimited) *.prn)" file.

EDIT:: Bugger :)
 
Upvote 0
This thread was incredibly timely since I had the same question too.

I AM creating the text file from VBA, however. Actually, I should say it's an ASCII file. I needed to save my new file with a specific suffix used by a stats package. Trouble was, Excel would insist on adding a .prn suffix so that my file would end up something like "myfile.ex.prn".

Easy enough to fix with VBA, though. I just went into the ActiveWorkbook.SaveAs command and fixed it there.

Thanks guys!
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top