findstr because of extra comma
Posted: 17 Jan 2018 10:01
Hello group,
We have a script that compares a file of email addresses (dump.txt) with a list of employees (pwd_raw.txt).
findstr /g:"dump.txt" "pwd_raw.txt" >output.txt
The file of email addresses has the email addresses, one per line, BUT it also includes a comma "," at the end of each line, immediately after the email address:
john.doe@company.com,
jenny.jones@company.com,
Because the list of employees in pwd_raw.txt does not include the comma "," the findstr is failing.
Our corporate IT policies are very strict and we cannot use apps that could easily remove the comma, such as FART or sfk.
Is there a way to:
1 - trim the comma from the email addresses
OR
2 - ignore the comma from the findstr
I have certainly been researching, including https://ss64.com/nt/findstr.html but have yet to find an answer I am able to use.
Any help would be appreciated.
Aisha
We have a script that compares a file of email addresses (dump.txt) with a list of employees (pwd_raw.txt).
findstr /g:"dump.txt" "pwd_raw.txt" >output.txt
The file of email addresses has the email addresses, one per line, BUT it also includes a comma "," at the end of each line, immediately after the email address:
john.doe@company.com,
jenny.jones@company.com,
Because the list of employees in pwd_raw.txt does not include the comma "," the findstr is failing.
Our corporate IT policies are very strict and we cannot use apps that could easily remove the comma, such as FART or sfk.
Is there a way to:
1 - trim the comma from the email addresses
OR
2 - ignore the comma from the findstr
I have certainly been researching, including https://ss64.com/nt/findstr.html but have yet to find an answer I am able to use.
Any help would be appreciated.
Aisha