Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- set row=0
- set inFile=merged.csv
- set outFile=final.csv
- if exist "%outFile%" del "%outFile%"
- >%outFile% (
- for /f "tokens=1,* delims=," %%A in (%inFile%) do (
- set /A row+=1
- set time=%%A
- set data=%%B
- REM : edit column headers and values here
- set head=machine,label
- set body=0,inlet-sparger
- if !row! lss 2 (
- REM : I have no idea why this needs to be separated
- REM : ...but it has to, or it doesn't work
- echo | set /p=!time!
- echo | set /p=,!head!,
- echo !data!
- ) else (
- echo !time!,!body!,!data!
- )
- )
- )
- if exist "%inFile%" del "%inFile%"
Add Comment
Please, Sign In to add comment