Code: Select all
Excerpt 1.
=======================
Excerpt 2.
=======================
Excerpt 3.
=======================
Code: Select all
Excerpt 1.
=======================
Excerpt 2.
=======================
Excerpt 3.
=======================
Code: Select all
// 2010-11-10 Concatenator: concatenat files
// Step through all files, if ext=txt read the file into an array
//init:
$ARRAY="";
$Count=0;
//Loop infinity:
while(true)
{
// add only files with ".TXT"-extension:
if("<curext>"=="txt")
{
$Count++;
//Info:
//the $ARRAY is the var to collect all the files,
//the READFILE will read the file into this array,
//the STRREPEAT-part will just format the output file and add a few blank lines
$ARRAY = $ARRAY
. readfile("<curname>")
. strrepeat("<crlf>", 5)
. strrepeat("******", 5)
. "<crlf> <FILE SEPARATOR> - <curname><crlf>"
. strrepeat("******", 5)
. strrepeat("<crlf>", 5) ;
}
//try next file:
sel "+ 1";
//if there is no more file to add...
if("<curname>"=="")
{
//if there was at least one file added:
if ($Count > 0)
{
//then create the collection file:
writefile("<curpath>\_alle.txt", " *** $Count concatenated files,
separated by <FILE SEPARATOR> ***<crlf><crlf><crlf>$ARRAY");
}
break;
}
//ELSE: proceed next file...
}
Code: Select all
::writeFile("zzzSEPARATOR.txt", "====End=of=File===SEPARATOR====End=of=File===", o); $a = readfile(<curitem>); copytext $a; writeFile("_MergedText.txt", "<crlf><crlf>$a<crlf><crlf>==================", a, tu); focus; sendkeys'{down}'; focus a; sendkeys"{enter}";