Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Maybe I need helpwith the find utility.  (Read 2646 times)

0 Members and 1 Guest are viewing this topic.

Geek-9pm

    Topic Starter

    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Maybe I need helpwith the find utility.
« on: June 01, 2018, 02:07:11 PM »
This is about the DOS find utility.

Maybe this could be a DOS script. I am not sure. Here is what I want.
I want to look in in all the TXT files I ever made to see what email address I have used at any time.

I have found already that I can not use the @ in search. I don't know why. Anyway, here is how I thin it might be done.

Let me say that I use a site called "FarDog.us" as a mail service. some my email address might be "[email protected]", but I  can not use the @ symbol. So I search on "fardog.us" and select ignore case. In Windows that gives my lots of files.So I copy them all to a USB stick.

{Mot my real e-mail. Just an example herein.}

So far, so good. Now I have a lot of TXT files on my K: drive, my USB thing.

Here is my question. How do I use he find utility to show me just show the fines that have the name of the website?
« Last Edit: June 01, 2018, 02:30:24 PM by Geek-9pm »

Salmon Trout

  • Guest
Re: Maybe I need helpwith the find utility.
« Reply #1 on: June 02, 2018, 12:05:25 AM »
I have found already that I can not use the @ in search. I don't know why.

Are you sure?

1. test.txt
Code: [Select]
a.line.of.text
[email protected]
some.more.txt
[email protected]
[email protected]

2. tryme.bat
Code: [Select]
@echo off
for %%a in (*.txt) do (
    type "%%a" | find "@fardog.us"
    )

3. Output of tryme.bat
Code: [Select]
[email protected]
[email protected]
« Last Edit: June 02, 2018, 12:25:24 AM by Salmon Trout »

Salmon Trout

  • Guest
Re: Maybe I need helpwith the find utility.
« Reply #2 on: June 02, 2018, 01:25:08 AM »
This is about the DOS find utility.

I have found already that I can not use the @ in search. I don't know why. Anyway, here is how I thin it might be done.

Code: [Select]
C:\Batch\Test\>find "@" *.txt

---------- TEST.TXT
[email protected]
[email protected]
[email protected]

C:\Batch\Test>find "@fardog.us" *.txt

---------- TEST.TXT
[email protected]
[email protected]

use a double FIND to get rid of the file names:

Code: [Select]
C:\Batch\Test>find "@fardog.us" *.txt | find "@fardog.us"
[email protected]
[email protected]
« Last Edit: June 02, 2018, 01:40:10 AM by Salmon Trout »