It is necessary to remove commas only inside quotes "". There is a file with many lines of this type (First Name, Last Name, Company, "Head of Product Development, Casino", Email, Phone Numbers, Notes, Tags) There is a regular-expression, but everything that is in quotes "[^"] is deleted * "
1 answer
You can use your regular expression in a PythonScript script, where a match can be further processed in a lambda expression.
- Install PythonScript
- Click Plugins -> Python Script -> New Script
- Create a
comma_removal.pyfile - Add a line to the file
editor.rereplace(r'"[^"]+"', lambda x: x.group().replace(",", "")) Now you can run the script from the menu Plugins -> Python Script -> Scripts -> comma_removal
|
editor.rereplace(r'"[^"]+"', lambda x: x.group().replace(",", "")). In general, better use the normal programming language for this (Perl, Python, C #, ...). - Wiktor Stribiżew