Answer» i'm doing some massive data analysis and need to concatenate the contents of many .txt files into one BIG .txt file. nothing fancy, just add them one after another.
i've tried 2 approaches, but neither has worked: ------------------------------- 1) ::** echo off > agreagate.txt
for %%F in (*.txt) do call :eleven %%F
goto :eof
:eleven
set FILEVAR=%1
echo %FILEVAR:~0,13% ::**
%FILEVAR:~0,13% ------------------------------------------- 2) for %%f in (*.txt) do type “%f” >> aggregate.txt
does anyone have any suggestions how this can be done? it must be really easy, but the exact syntax escapes me at the time. i am not a batch file expert, by any means.the "copy" command can be made to emulate cat.
Code: [Select]copy /b file1.txt+file2.txt+file3.txt bigfile.txt
unless you are restricted in any way , why do you WANT to emulate cat? Download the GNU tools for windows (see my sig).
Code: [Select]c:\TEST> cat file*.txt > newfile.txt i'm stuck on a windows without administrative privilege=> installing stuff is a pain=> i can't do the emulator.
about the copy, i've tried
for %%f in (*.txt) do copy “%%f” >> aggregate.txt
i know that what you wrote works, for a few files, but i have hundreds of files, and can't type them all out by hand. so i'm trying to write a for loop that takes all the .txt files in a folder and concatenates their text together.
my for loop almost works, except i get hundreds of
"The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified."
it's the right number, but i have the syntax wrong somehow on finding the files. can anyone help out with that? i CANNOT type all the file names...it would take forever.copy /a *.txt aggregate.txt
is the solution i was LOOKING for. found it on a different blog. hope it helps someone here also.
|