I have several Textfiles with a header of no interest and some relevant data. I want a new file with all the important data:
Example:
File1 has text:
Created on 02.02.2016
Country: Chile
Figure of Station: CAL
Frequency: 220 Hz
Messuring: 15 hours
File2 has text:
Created on 02.02.2016
Country: Chile
Figure of Station: GUA
Frequency: 220 Hz
Messuring: 14 hours
I would like to have new csv with all important data looking like:
CAL 220 Hz 15 hours
GUA 220 Hz 14 hours
Is it possible to do something like this with a batch file?
I know about copy .csv
all .txt
but this doesn't work here.
Here is a batch script I have as well.
@echo off
setlocal EnableDelayedExpansion
if exist result.csv del result.csv
for %%f in (*.txt) do (
set i=0
for /F "delims=" %%l in (%%f) do (
set /A i+=1
set line!i!=%%l
)
echo %%f, !line1!, !line2!, !line3!, !line4!, !line5!, >> result.csv
)