Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. @echo off
  2.  
  3. setlocal enabledelayedexpansion
  4. set row=0
  5.  
  6. set inFile=merged.csv
  7. set outFile=final.csv
  8.  
  9. if exist "%outFile%" del "%outFile%"
  10.  
  11. >%outFile% (
  12. for /f "tokens=1,* delims=," %%A in (%inFile%) do (
  13. set /A row+=1
  14. set time=%%A
  15. set data=%%B
  16.  
  17. REM : edit column headers and values here
  18.  
  19. set head=machine,label
  20. set body=0,inlet-sparger
  21.  
  22. if !row! lss 2 (
  23. REM : I have no idea why this needs to be separated
  24. REM : ...but it has to, or it doesn't work
  25.  
  26. echo | set /p=!time!
  27. echo | set /p=,!head!,
  28. echo !data!
  29. ) else (
  30. echo !time!,!body!,!data!
  31. )
  32. )
  33. )
  34.  
  35. if exist "%inFile%" del "%inFile%"
Add Comment
Please, Sign In to add comment