Code: Select all
//Combine selected files in order
"Concatenate Files"
$itemCount = get("CountSelected");
if ($itemCount < 2){
msg "Please select two or more files to concatenate.", 0 + 48;
}
else {
//No modifier keys pressed - use defaults
$outputFileExt = getpathcomponent("<selitem>", "ext");
//Initialise variables used in loop
$outputFilePath = <curpath> . "\" . <date yyyy-mm-dd-hh-mm-ss> . ".$outputFileExt";
$index = 0;
//Process files
foreach($token, <get selecteditemspathnames |>) {
$index = $index + 1;
$fileContent = readfile("$token");
writefile("$outputFilePath", $fileContent, "a");
}
status "Concatenated file generation complete - $outputFilePath";
}
In the example archive I put two text files I want to join (a.txt and b.txt). After I join them the joined file is SMALLER than the largest file! Also, when I compare them I see it goes wrong after a while (not the whole large file is joined).
Code: Select all
a.txt = 120594130 bytes
b.txt = 14565900 bytes
join.txt = 119423500 bytes
PS
I doubted where to post this bug/question. Should I have posted this in the questions forum? Or in the bugs forum?