Page 1 of 1

Combine Files

Posted: 04 Feb 2010 16:44
by hieubm
I have files like: XYZ.iso.001, XYZ.iso.002,...
and I want to combine these files into only single file. But XYplorer doesn't support this feature.

It's very good if this feature appears in the next version.

Re: Combine Files

Posted: 04 Feb 2010 17:09
by j_c_hallgren
hieubm wrote:I have files like: XYZ.iso.001, XYZ.iso.002,...
and I want to combine these files into only single file. But XYplorer doesn't support this feature.

It's very good if this feature appears in the next version.
You are correct in that XY doesn't support it and I really doubt it will...and by the way, asking for a given feature in "next version" isn't the best way to phrase your request here...Don will add features if and when he wants which might be soon or much later...

Having said that, I found this older thread where there is a script by serendipity that may help with this...see http://www.xyplorer.com/xyfc/viewtopic. ... 967#p34967

Re: Combine Files

Posted: 05 Feb 2010 04:03
by hieubm
Sorry, but I searched.
I searched "combine files", I searched "join files", ...
I searched by XYplorer search engine, I searched by Google..
But I didn't find anything, and then...I posted.

Scripts is powerful, but it's not for general users. And I hope XYplorer will has a command to do this (in File menu and right-click menu). And until now, it is not a given feature.

Hope Don will add it soon.

Re: Combine Files

Posted: 05 Feb 2010 04:54
by j_c_hallgren
hieubm wrote:Sorry, but I searched.
I searched "combine files", I searched "join files", ...
I searched by XYplorer search engine, I searched by Google..
But I didn't find anything, and then...I posted.
I appreciate that you attempted to locate it first as often people don't...and I used the same forum search "join files" but also looked for "001 002" which helped...
Scripts is powerful, but it's not for general users.
You didn't specify which vers you were using so if it's the Home Edition then scripting isn't available unfortunately...and while writing scripts may not be for everyone, anyone can make use of a script from others (presuming you have the Pro Edition)...
And I hope XYplorer will has a command to do this (in File menu and right-click menu). And until now, it is not a given feature. Hope Don will add it soon.
Given that this type of split files isn't nearly as common these days as it was years ago, and his comment in the other thread, I wouldn't be too hopeful, especially since there are other ways to accomplish this function...but I'd see what Don says himself.

Re: Combine Files

Posted: 05 Feb 2010 05:44
by hieubm
You didn't specify which vers you were using so if it's the Home Edition then scripting isn't available unfortunately...and while writing scripts may not be for everyone, anyone can make use of a script from others (presuming you have the Pro Edition)...
I'm using the Pro Edition. The word "general users" I said means non-IT users. And I want XYplorer be easier for everyone.

Re: Combine Files

Posted: 05 Feb 2010 06:28
by j_c_hallgren
hieubm wrote:I'm using the Pro Edition. The word "general users" I said means non-IT users. And I want XYplorer be easier for everyone.
Good! That means you can make use of Scripts! And by doing so, you can extend the capabilities of XY in areas that Don may not wish to bother with or in custom areas unique to your needs...there are quite a few scripts already written and also users in forum who can assist in creating or tweaking them...they may not solve every situation but can handle a great nbr of them.

So that makes it easier for almost everyone...easier for Don to code & maintain just the scripting language...easier for users who don't have to wait on or rely on him to code a feature into XY...a win for both sides.

Re: Combine Files

Posted: 05 Feb 2010 08:29
by admin
AFAIK this is the first request I ever got for joining files. I know that other file managers offer split and join, but these are features from the 90s that just survive as rudiments (I thought).

Re: Combine Files

Posted: 05 Feb 2010 09:12
by j_c_hallgren
admin wrote:AFAIK this is the first request I ever got for joining files. I know that other file managers offer split and join, but these are features from the 90s that just survive as rudiments (I thought).
In the thread that I mentioned with the script from last July http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=3802, it's listed as item #4 by the OP
4) I know other software can do this, but would it be possible to add a "join" fx for ".001" files and "join & delete files" to join the .001 files then move the original .001, .002, etc.. to recycle bin. There's NO program as of 7/2/09 that can do this. They can join, but not delete the remaining files. I currently use 7Zip to join the files, but then have to manually delete the .00* files. It's a major PITA.
...ok, so that also requested a "join & delete" but it did request a "join"...though admittedly you didn't participate in that thread.

But it was somewhat also referred to (a bit indirectly maybe) about a month ago in http://www.xyplorer.com/xyfc/viewtopic.php?f=2&t=4516 where you did post twice...and your
admin wrote:I'd say this is too weird to be supported.
was the basis for me to wonder if you would support the "join" and thus reply as I did above here.

I know I can't keep track of everything so I don't expect you to! 8)

Re: Combine Files

Posted: 05 Feb 2010 10:41
by admin
j_c_hallgren wrote:
admin wrote:AFAIK this is the first request I ever got for joining files. I know that other file managers offer split and join, but these are features from the 90s that just survive as rudiments (I thought).
In the thread that I mentioned with the script from last July http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=3802, it's listed as item #4 by the OP
4) I know other software can do this, but would it be possible to add a "join" fx for ".001" files and "join & delete files" to join the .001 files then move the original .001, .002, etc.. to recycle bin. There's NO program as of 7/2/09 that can do this. They can join, but not delete the remaining files. I currently use 7Zip to join the files, but then have to manually delete the .00* files. It's a major PITA.
...ok, so that also requested a "join & delete" but it did request a "join"...though admittedly you didn't participate in that thread.

But it was somewhat also referred to (a bit indirectly maybe) about a month ago in http://www.xyplorer.com/xyfc/viewtopic.php?f=2&t=4516 where you did post twice...and your
admin wrote:I'd say this is too weird to be supported.
was the basis for me to wonder if you would support the "join" and thus reply as I did above here.

I know I can't keep track of everything so I don't expect you to! 8)
Ok ok, I should sometimes even click on your links... :oops:

Re: Combine Files

Posted: 10 May 2013 18:13
by wogone
Hi!

I'm glad I have found other people wanting to use XYplorer scripting to join several files together. I wanted a more general script that will combine any files - regardless of whether their extension is .001 .002 or whatever.

I have modified the code in the old thread that was linked to and got this more generic code:

Code: Select all

//Get info for deleting files later
  $delete= getinfo ("SelectedItemsPathNames", "|");
//Get info of file paths
  $files= getinfo ("SelectedItemsPathNames", "+");
//remove path and retain names
   replace $files, $files, "<curpath>\","";
//find first instance of +
  strpos $select, $files, "+";
//extract file name
  substr $name, $files, 0, $select; 
//run from command prompt
  run "cmd /c copy/b $files Joined_$name";
// You have the option to delete /and recycle. 
  delete 1,1, $delete;
I have two issues:
1) It won't work with files containing a space in the name, as the $files need to be wrapped in "" quotes. Any ideas how I do this with replace?
2) It would be nice if the file browser window updated itself before showing the popup asking if you want to delete the source files... That way you can be sure that your joined file has been produced!

Any help would be greatly appreciated!

And finally (forgive me for not conducting a big search of the website) - is there a repository of XYplorer scripts? I'd like to browse through other people's offerings.. but it's rather hard finding them in amongst forum posts.

Re: Combine Files

Posted: 10 May 2013 20:53
by highend

Code: Select all

  $files = get("SelectedItemsPathNames", "|");
  $firstFile = getpathcomponent(gettoken($files, 1, "|"), "file");
  $quotedFiles = quote(replace($files, "|", '" + "'));
  run "cmd /c copy /b $quotedFiles ""<curpath>\Joined_$firstFile""", , 2, 1;
  #485; // Refresh current list
  delete 1, 1, $files;
Something like this?

Re: Combine Files

Posted: 10 May 2013 21:57
by Stefan
Or like that

Code: Select all

 //Store full path to origin files to delete them later:
   $delete = getinfo ("SelectedItemsPathNames", "|");
   
 //Get names only of selected files in quotes:
   $files  =  chr(34) . getinfo("SelectedItemsNames", """+""") . chr(34);
 //Prompt user and ask to continue:
   $join   = confirm( "Join this files now?<crlf 2>$files" );
   end($join==0), "Cancelled by user.";
    
 //Get first file name to reuse for combined file:
   $name   = gettoken( $files, 1, "+");
   $name   = replace( $name , '"','');
   $name   = "Joined_$name";
   $name   = input("Combine as", "New name for combined files:",$name);
   $nameQ  = quote($name);
 //Prompt user and ask to continue:
   msg "We gonna join selected files as: $nameQ",1;
    
 //Run from command prompt
   run "cmd /c copy/b $files $nameQ";
   
    
 //Delete origin files routine:
    //Only if combined file exists:
    if( exists("<curpath>\$name")==1 ){
       //Prompt user and ask to continue:
       $del = confirm( "Delete now this files?<crlf 2>" . replace($delete,"|","<crlf>") );
       If($del==1){ 
            msg "Ok, we delete now";
            // You have the option to delete /and recycle.
            //  delete 1,1, $delete;
       }else{
           msg "Fine, we keep original files too.";
       }
    }

That remind me on at least one another way (for text files) over there >> Text-merging Tool


.