I have a csv file that I need to revise, here is a snippet from it:
1.1.1,"1, 8, 11, 13"
1.1.2,"10, 11, 12"
1.1.3,"2, 3, 10, 11, 13"
I want to format it like this:
1.1.1,1
1.1.1,8
1.1.1,11
1.1.1,13
1.1.2,10
1.1.2,11
1.1.2,12
1.1.3,2
1.1.3,3
1.1.3,10
1.1.3,11
1.1.3,13
I am using the search replace function within a text editor, w/ the regular expression option enabled.
I can’t think of a way to match when the number of values in the quoted part varies as your data does, but if there aren’t too many variations, you could use something like this and just fiddle about by adding
,\s*(\d+)to the Find part and\n\1,\5to the Replace part a few times to catch all permutations.Find:
Replace:
This works in Notepad++ for the second line of your example.