Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
@echo off
setlocal EnableDelayedExpansion
if exist result.csv del result.csv
for %%f in (*.txt) do (
set i=0
for /F "delims=" %%l in (%%f) do (
set /A i+=1
set line!i!=%%l
echo %%f, !line1!, !line2!, >> result.csv

This comment has been minimized.

Copy link

commented May 17, 2015

I want to combine arabic text. So could you please tell me how I can convert final result file to be in UTF-8 format. With your script it is saving in ANSI and am getting a garbage file at the end.



This comment has been minimized.

Copy link
Owner Author

commented Sep 19, 2015

That's a very good question. I'm not sure how to do that, but it shouldn't be too hard, one would imagine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.