How to arrange , separated text (add every 24th comma to \n)
1. I got RGB color map value (256*3) = 768 values as below:
colorarray07[256*3] = {
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
...
}
2. I would like to arrange like this:
colorarray07[256*3] = {
0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255,
...
}
3. Using VSCODE, I copied value section to vscode.
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
...
4. Replace all using following condition with regex on (to make one line text)
,\n
to
,
5. Replace all using following condition with regex as follows:
([0-9]+\,){24}
to
$0\n
6. It works like charm.
colorarray07[256*3] = {
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
...
}
2. I would like to arrange like this:
colorarray07[256*3] = {
0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255,
...
}
3. Using VSCODE, I copied value section to vscode.
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
0,0,255,
...
4. Replace all using following condition with regex on (to make one line text)
,\n
to
,
5. Replace all using following condition with regex as follows:
([0-9]+\,){24}
to
$0\n
6. It works like charm.
Comments