How to display unique file from list of files in a folder

August 21, 2017 at 07:23:59
Specs: Windows 10
I have 3 set of different files with (.txt, .res, .csv extensions) in one folder , however with slightly similar filename but different extensions.
I want to merge the content of the files into body of an email.

I am new to scripting and finding it very difficult to finish it. Please help.

Thanks


See More: How to display unique file from list of files in a folder

Reply ↓  Report •

#1
January 16, 2018 at 03:56:52
This will merge all files to one "-all.txt" file, so just the first step.

please replace unique to whatever string is used in your file-set

::----start of test.bat----
@echo off
::they all contain this string:
set "similarity=unique"
for /f %a in ('dir/b/A-D ^| findstr "%similarity%"') do echo.>>output.txt&echo file: "%a">>output.txt&type "%a">>output.txt
echo result, saved to %~dp0output.txt:
type output.txt
::----end of test.bat----

i5-6600K@4.670GHz/4.448GHz cache@1.33v | 2x4GB Crucial-DDR4-2133@ 15-15-15-31 2T 2817MHz@1.3v | ASUS Z170-K | Samsung 250GB SSD 850 EVO | MSI RX 570 4GB@1384cc&2087mc bios-powertune-mod | Corsair VS45


Reply ↓  Report •
Related Solutions


Ask Question