Batch file to split .csv file

前端 未结 6 788
醉酒成梦
醉酒成梦 2020-11-29 04:44

I have a very large .csv file (>500mb) and I wish to break this up into into smaller .csv files in command prompt. (Basically trying to find a linux \"split\" function in Wi

6条回答
  •  Happy的楠姐
    2020-11-29 05:08

    This will give you lines 1 to 20000 in newfile1.csv
    and lines 20001 to the end in file newfile2.csv

    It overcomes the 8K character limit per line too.

    This uses a helper batch file called findrepl.bat from - https://www.dropbox.com/s/rfdldmcb6vwi9xc/findrepl.bat

    Place findrepl.bat in the same folder as the batch file or on the path.

    It's more robust than a plain batch file, and quicker too.

    findrepl /o:1:20000 newfile1.csv
    findrepl /o:20001   newfile2.csv
    

提交回复
热议问题