CSV output issues!

patrickmuldoon99

Active Member
Joined
Jun 27, 2006
Messages
345
Hello one and all

I have a sub routine that opens loads of different XLS documents, and outputs them as CSV's into another folder on my computer. This works fine.

My problem is that I have discovered that certain XLS files have random commas inside the text strings - for example, there is a list of attributes of a product going down the left hand side, and one of them is:

'3 - 3,5 INCH'

Now despite the fact that this is one column in XLS, obviously, the comma is kept and when I try to process the CSV file (as a text file, using Split), 3-3 is one field, and 5 INCH is another (which causes big problems)

Is my only alternative to write a sub routine that finds and replaces all commas as "" when the files are opened before outputting? Or is there some easier way to do this.

Any help, as ever, greatly appreciated

cheers guys

patrick
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
As ever, the mere act of posting has made me think more clearly about such problems.

Sorted now, was a couple of lines of code to replace commas with full stops in the XL file before outputting to CSV.

Cheers anyway all

Patrick
 
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