Delimit by commas on certain fields only

hutchisd

New Member
Joined
Feb 16, 2009
Messages
49
I have a csv file I am importing into Excel. All columns are comma delimited but there is a description column that contains commas, which is causing some problems. Is there a way to delimit only certain columns by commas and not delimit by commas in another column?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This may be possible if you can find some kind of pattern that will allow you to identify the commas that are in the descriptions, and distinguish them from the others.

Can you do that ?

Or can you post maybe 2 or 3 examples of your data so that maybe people on this board can identify patterns ?

For example, if all the commas within descriptions were followed by a space character, and none of the others were, you could use Edit, Find and Replace, to find all the instances of ", " and replace them with some text string, let's say "zzz".
Then the remaining instances of "," would all be valid delimiters, and you could import the data.
Finally, you could use Find and Replace to find all the instances of "zzz", and replace them with ",".
 
Upvote 0
This may be possible if you can find some kind of pattern that will allow you to identify the commas that are in the descriptions, and distinguish them from the others.

Can you do that ?

Or can you post maybe 2 or 3 examples of your data so that maybe people on this board can identify patterns ?

For example, if all the commas within descriptions were followed by a space character, and none of the others were, you could use Edit, Find and Replace, to find all the instances of ", " and replace them with some text string, let's say "zzz".
Then the remaining instances of "," would all be valid delimiters, and you could import the data.
Finally, you could use Find and Replace to find all the instances of "zzz", and replace them with ",".

I don't have an example since I'm on my home computer and not at work right now, but I did think about the possibility of there being a space after the comma in the column I don't want to delimit. There was no space so that wouldn't work. I did get the csv file changed to a tab delimited file from the person that generates the file, so it's not an issue anymore. I would like to see if there is a solution for this though, just for future reference. Thanks for the suggestion though!
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,921
Latest member
BBQKING

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