[Help] Mini.align - How to ignore delimiter if it's inside double quotes #361
-
As title, google sheet CSV format would put each column data as is if there is no comma inside and will wrap the column data inside double quote to differentiate with legitimate delimiter. I have gone through the help file but could not a way to do this. Not sure if the plugin supports this capability or not.
gAip, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Edit: Somewhat ignore this answer. There is a better built-in interactive way. This question is relevant to me too, as I do quite frequently work with .csv files. But I don't think I found a way to organically fit this type of separator ignore into interactive mode of 'mini.align'. There are two approaches here I can recommend:
|
Beta Was this translation helpful? Give feedback.
-
Apparently, I forgot how my modules work 😞 There is an If you want to ignore inside both local align = require('mini.align')
align.setup({
modifiers = {
i = function(steps, _) table.insert(steps.pre_split, align.gen_step.ignore_split({ '".-"', "'.-'" })) end,
},
}) |
Beta Was this translation helpful? Give feedback.
Apparently, I forgot how my modules work 😞
There is an
i
modifier (forignore
) that does just that: adds matches inside""
to be ignored. So you cangAip
followed by,
to set separator and followed byi
to add "ignore" pre-split step.If you want to ignore inside both
''
and""
, you can customizei
modifier like so: