I'm in need of this these days, and I ended up writing a PowerShell script:
$InputFolder = $args[0] $OutputFile = $args[1] $BinStream = [System.IO.FileStream]::new($OutputFile,[System.IO.FileMode]::OpenOrCreate) $BinWriter = [System.IO.BinaryWriter]::new($BinStream) $InputFolder | Get-ChildItem | Sort-Object -Property LastWriteTime | ForEach-Object { $Data = $_ | Get-Content -AsByteStream -Raw $BinWriter.Write($Data) } $BinWriter.Close()
You can sort by a different object property, maybe datetime of creation, LastWriteTime just happens to be the one that I needed. The reason I cannot sort by name is that my file names do not have the index suffix padded with zeros.
There's probably a more straight-forward way, without diving into .NET classes, but I don't have much of a PowerShell skill, so whatever I put together to satisfy my immediate need is a result of quick googling and browsing through PowerShell reference online.
Nameproperty:$sourceFiles = (Get-ChildItem .\file*.csv).Name-Nameparameter switch will give JUST the name of the file. [or the relative path & the name] if you want the full path, then grab the value in the.FullNameproperty.