Home > Scripting > Split CSV to TXT

Split CSV to TXT

Question: How to split a csv file in one txt file per line? The first column in the CSV provides the name for the TXT-file and the second one the contents.

SetLocal EnableDelayedExpansion
for /f %%i in (inp.csv) do set var=%%i& set name=!var:~0,6!& set phone=!var:~7,4!& echo !phone!>>!name!.txt
EndLocal
Categories: Scripting Tags:
  1. No comments yet.
  1. No trackbacks yet.