I have a data file (*.js) per day with the following content:
m[mi++]="26.03.23 23:55:00|0;0;0;2720;0;0;0|488;0;3270"
m[mi++]="26.03.23 23:50:00|0;0;0;2720;0;0;0|1360;0;3220"
m[mi++]="26.03.23 23:45:00|0;0;0;2720;0;0;0|192;0;3110"
...
I would like to merge all files into one file per month. This works with the following command in Windows Powershell:
cat *.js > 2023_04.csv
But before merging, I would like to do a few operations first:
- reverse the order of the file so the time is ascending instead of descending
- remove the 'm[mi++]="' at the beginning of every line
- remove the '"' at the end of every line
- replace the '|' with ';' on every line
Is this possible in Powershell? If not, what would be the best choice to create a script for this?
I can merge multiple files into one file with the 'cat' command in Windows Powershell.