Sync Dirs: export left/right list to file

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
wanderer
Power Member
Power Member
Posts: 1578
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Sync Dirs: export left/right list to file

Post by *wanderer »

It would be useful if Sync Dirs function supported exporting the left / right list of currently visible files (after applying the filters in the top of the window) to a text file, in the form "Folder\Filename", one per line.

If done, it would also be nice to have an option to append the parent path before "Folder\Filename" in each line, so that a list with full path of every file can be created.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I think you can currently parse tab-separated text that is copied by TC on Ctrl+C.
User avatar
wanderer
Power Member
Power Member
Posts: 1578
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Post by *wanderer »

Thanks for the info, didn't know that. Unfortunately it's not very convenient if you want to work with one of the two filelists though. You have to separate the left or right filenames plus you have to add the path in front of them...
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3
x64: Clients/Servers from Win7 to Win11 and Win2K12Srv to Win2K22Srv, mainly Win10 though.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

That's why I've mentioned parsing. :wink:

E.g. with PowerShell (tcGetSyncList.ps1 and tcGetSyncList.bat):

Code: Select all

param($syncListFile, $isRightSide);

Add-Type -AssemblyName System.Windows.Forms;


function getFileList($syncLines, $isRight) {
	$subpath = '\';
	$columns = 0, 8;
	foreach ($line in $syncLines) {
		$items = $line.Split("`t");
		if ($items.Length -eq 1) {
			$subpath = "\$line";
		}
		else {
			$name = $items[$columns[$isRight -ne $false]];
			if ($name) {
				$subpath + $name;
			}
		}
	}
}


if ($syncListFile -eq 'clip:') {
	$syncLines = [Windows.Forms.Clipboard]::GetText().Split([char[]]"`r`n", [StringSplitOptions]::RemoveEmptyEntries);
}
else {
	$syncLines = [IO.File]::ReadLines($syncListFile);
}
$isRightSide = [bool](iex $isRightSide);

getFileList $syncLines $isRightSide;

Code: Select all

@powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dpn0.ps1" %*
Usage:

Code: Select all

tcGetSyncList.bat 1.txt 0
tcGetSyncList.bat clip: 1
However copied data doesn't contain information about root left or right path.
Post Reply