I have a large data set that I'd like to convert into a workable csv file. The dataset currently looks like this:
[att1]; [att2]; [att3]; [att1]; (...)
To make this a workable csv-file, I'd need to insert a line-break after every third semi-colon.
[att1]; [att2]; [att3];
[att1]; [att2]; [att3]; (...)
Using VS Code's find and replace feature, how can I achieve this?
See regex101 demo
If your data is all on one line with the formatting you showed - [.*?];
then
Find: ((\[.*?\]; ?){3})
Replace: $1\n
seems to do the job. It finds 3 of those att's
with an optional space between them and adds a newline after that group of three.
If your data doesn't actually have the []'s
, like att1; att2; att3;
you can use this find:
Find: ((.*?; ?){3})