I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
Maxmillian wrote:
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
Are the email addersses separated in any way, with commas, spaces, tabs,
or semicolons?
If so, import each list into a speadsheet so that there is one email
address per line. Sort the lines. Compare the two spreadsheets.
Look up fc for file compare
fc /?
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
23.03.2023 19:31, Maxmillian wrote:
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
Because you posted in alt.msdos.batch, here a batch solution:
@echo off
:: list all email addresses which are not in both
:: input files (email1.txt, email2.txt)
if [%1]==[sub] goto :sub
sort email1.txt|find "@" >email1s.txt
sort email2.txt|find "@" >email2s.txt
cmd /c %0 sub
del email1s.txt
del email2s.txt
goto :eof
:sub
setlocal EnableDelayedExpansion
3<email1s.txt 4<email2s.txt (
set line1a=&set /P line1a=<&3
set line2a=&set /P line2a=<&4
set line1b=&set /P line1b=<&3
set line2b=&set /P line2b=<&4
for /l %%i in (1,1,100000) do (
if /I [!line1a!]==[!line2a!] (
if [!line1a!]==[] exit
set line1a=!line1b!
set line2a=!line2b!
set line1b=&set /P line1b=<&3
set line2b=&set /P line2b=<&4
) else (
if /I [!line1a!]==[!line2b!] (
echo !line2a! in email2.txt but not in email1.txt
set line2a=!line2b!
set line2b=&set /P line2b=<&4
) else (
if /I [!line1b!]==[!line2a!] (
echo !line1a! in email1.txt but not in email2.txt
set line1a=!line1b!
set line1b=&set /P line1b=<&3
) else (
echo !line1a! in email1.txt but not in email2.txt
echo !line2a! in email2.txt but not in email1.txt
set line1a=!line1b!
set line2a=!line2b!
set line1b=&set /P line1b=<&3
set line2b=&set /P line2b=<&4
)
)
)
)
)
That is just sheer genius.
The answer from ChatGPT:
set v=39/2023
set v1=%v:/=&rem.%
set v2=%v:\=&rem.%
echo "%v%", "%v1%", "%v2%"
Ok, v2 is wrong, but that is the trivial part of the question.
But v1 is really good!!!
Andy Burns wrote:
It it actually using undefined CMD behaviour?
Normal behavior, "/" is replaced by "&rem.", so you get:
set v1=39&rem.2023
which is equivalent to the two lines:
set v1=39
rem.2023
Herbert Kleebauer wrote:
The answer from ChatGPT:
set v=39/2023
set v1=%v:/=&rem.%
It it actually using undefined CMD behaviour?
23.03.2023 19:31, Maxmillian wrote:
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
Because you posted in alt.msdos.batch, here a batch solution:
@echo off
:: list all email addresses which are not in both
:: input files (email1.txt, email2.txt)
On 24.03.2023 01:49, Herbert Kleebauer wrote:
23.03.2023 19:31, Maxmillian wrote:
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
Because you posted in alt.msdos.batch, here a batch solution:
@echo off
:: list all email addresses which are not in both
:: input files (email1.txt, email2.txt)
Sorry, this code doesn't work at all. Was to late yesterday,
but I wanted to try the idea of reading more input files
at the same time (was presented many years ago in a.m.b.nt).
Better use a small C program.
That is just sheer genius.
You should win a nobel prize for that as a diff has been the bane of
Windows users for years!
It's going into my batch folder immediately!
On 3/23/2023 2:31 PM, Maxmillian wrote:
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
On 24.03.2023 01:49, Herbert Kleebauer wrote:
23.03.2023 19:31, Maxmillian wrote:
I have two long lists of email addresses in Windows 10 as text files.
How can I lowercase everything and then get a diff of what email
addresses are in one text file but not in the other text file?
Because you posted in alt.msdos.batch, here a batch solution:
@echo off
:: list all email addresses which are not in both
:: input files (email1.txt, email2.txt)
Sorry, this code doesn't work at all. Was to late yesterday,
but I wanted to try the idea of reading more input files
at the same time (was presented many years ago in a.m.b.nt).
Better use a small C program.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (2 / 14) |
Uptime: | 06:39:52 |
Calls: | 6,666 |
Files: | 12,213 |
Messages: | 5,336,029 |