On the last substitute command, you used "g". This means for every occurrence in a line. You don't need this since, it can only happen once per line. Additionally, you use the caret (^) to force the pattern to start at the beginning of a line, making "g" even more superfluous. Vim has a builtin :sort command that works the same way as !sort although it's options are a bit different.
@@SeniorMarsTries yep commas are the defacto separator in csv, but your file is separated by pipes, that's why it's a bit weird, but I guess commas are converted by vim to the current csv separator?
when you did search and replace with Confirm, you could've pressed A, and done it not using global command. I like the video since I learnt something. :-)
- '$bDA' what about '$bc$' or even '$bcw' (for change to the end of line, or change next word) ? - ':3,999norm...' what about ':3,$norm...' - in regex, to match numbers you can use '\d\+' - for the underscore to dot, you can simplify to: ':g/\d\+_/norm f_r.' You're welcome (;
On the last substitute command, you used "g". This means for every occurrence in a line. You don't need this since, it can only happen once per line. Additionally, you use the caret (^) to force the pattern to start at the beginning of a line, making "g" even more superfluous.
Vim has a builtin :sort command that works the same way as !sort although it's options are a bit different.
Great video and it's always good to see how someone does macros and substitutions and take something from it.
nice video, one question please, why comma in the regex?
Commas are used as delimiters in csv files. I need to specify of our search.
@@SeniorMarsTries yep commas are the defacto separator in csv, but your file is separated by pipes, that's why it's a bit weird, but I guess commas are converted by vim to the current csv separator?
@@davidhenrryt yes. That is the case. I think I installed a plug-in.
when you did search and replace with Confirm, you could've pressed A, and done it not using global command.
I like the video since I learnt something. :-)
you could use Python pandas for csv files
You could have, but that would ruin the point of the video
- '$bDA' what about '$bc$' or even '$bcw' (for change to the end of line, or change next word) ?
- ':3,999norm...' what about ':3,$norm...'
- in regex, to match numbers you can use '\d\+'
- for the underscore to dot, you can simplify to: ':g/\d\+_/norm f_r.'
You're welcome (;
To me it would have made more sense to do both changes in one macro. For example
qe0f_r.$bcwTRUE
jjj...19x
kkk...31x
jjj...9x
lll...17x
kkk...11x
jhhh...24x
Oh God, stop it!