I have been CSVKIT on my mac, but I am moving my workflow to a PC platform so others will be able to access my workflow. One of the items I have been using was in2csv for converting Fixed Width file formats. On the mac I have it setup for batch processing:
for x in $(ls desktop/fixedwidth/*.txt); do x1=${x%%.*}; in2csv -f fixed -s desktop/ff/schema.csv $x > $x1.csv; echo "$x1.csv done."; done
I have tried converting this to a PC command-line option that I can run from a batch file, but i haven't had any luck
for /r %%i in (*.csv) do c:\programdata\python\python36\scripts\in2csv -f fixed -s c:\users\username\desktop\in2cs_schema\test_schema.csv c:\users\username\desktop\test_files\*.txt > c:\users\username\desktop\test_files\*.csv %%i
If I run the command by itself it works without an issue:
c:\programdata\python\python36\scripts\in2csv -f fixed -s [SCHEMA PATH] [FIXEDWIDTH PATH] > [OUTPUT PATH]
I feel like I am missing something simplistic, any help would be greatly appreciated!