3

I have several hundred files that need to be concatenated into a single file, much like this question. The problem is, that my files must must be in order. They are named with a Julian date followed by the file type.

Here's an example of the naming schema:

152_1605.old
155_0935.old
156_1535.old

etc.

This is not something I do very often and I could write my own complicated script to do this, but I feel there is a much easier way to do it and I just don't know what that way is.

mawburn
  • 214

1 Answers1

6

This is a powershell two-liner:

$TextFiles = Get-Item C:\Users\sudo\Documents\MachineLists\*.list

$TextFiles | sort | foreach { Add-Content -Value $(Get-Content $_) -Path C:\users\sudo\Desktop\concat.LIST}

As you can see from the first line it helps if they're all in the same folder, which I'm sure you won't have a problem with.

MDMoore313
  • 6,336