Split multiple CSV files in batch
<p>I have used this script found here on SO:</p>

<p><a href="https://stackoverflow.com/questions/20602869/batch-file-to-split-csv-file">Batch file to split .csv file</a></p>

<pre><code>@echo off
setLocal EnableDelayedExpansion

set limit=50
set file=export.csv
set lineCounter=1
set filenameCounter=1

set name=
set extension=
for %%a in (%file%) do (
    set "name=%%~na"
    set "extension=%%~xa"
)

for /f "tokens=*" %%a in (%file%) do (
    set splitFile=!name!-part!filenameCounter!!extension!
    if !lineCounter! gtr !limit! (
        set /a filenameCounter=!filenameCounter! + 1
        set lineCounter=1
        echo Created !splitFile!.
    )
    echo %%a&gt;&gt; !splitFile!

    set /a lineCounter=!lineCounter! + 1
)
</code></pre>

<p>This splits one file into several smaller files (50 lines each).I would like to get it to split all the files in a specific/current directory.</p>