Batch File Search
Moderator: DosItHelp
Batch File Search
Hello,
I need help!
I have txt file with a lot text inside. Every row is for itself.
Format look somethink like this.
first.last@domena.tld:*password*:blablablallb dsaldasl da lkasdlas ldk
first2.last2@domena2.tld:*password*:blablablallb dsaldasl da lkasdlas ldk
first3.last3@domena3.tld:*password*:blablablallb dsaldasl da lkasdlas ldk
I want to search domena.tld and have output like this:
first.last@domena.tld - password
first2.last2@domena.tld - password
....
Can someone help me?
Thx, Kruno
I need help!
I have txt file with a lot text inside. Every row is for itself.
Format look somethink like this.
first.last@domena.tld:*password*:blablablallb dsaldasl da lkasdlas ldk
first2.last2@domena2.tld:*password*:blablablallb dsaldasl da lkasdlas ldk
first3.last3@domena3.tld:*password*:blablablallb dsaldasl da lkasdlas ldk
I want to search domena.tld and have output like this:
first.last@domena.tld - password
first2.last2@domena.tld - password
....
Can someone help me?
Thx, Kruno
Re: Batch File Search
this is great. thank you. a step forward.
can you customize this in the way, that I insert the domain and script find only that?
thank you once more
can you customize this in the way, that I insert the domain and script find only that?
thank you once more
-
- Posts: 22
- Joined: 20 Nov 2012 12:42
Re: Batch File Search
using foxi code
@echo off
for /f "tokens=1,2 delims=:" %%a in (file.txt) do echo %%a - %%b | findstr /l /i "DOMAIN_CHANGE_THIS_"
its all one line except @echo off that is in the first line
If you want something with user input
@echo off
:a
echo Enter Domain
set /p dom=
for /f "tokens=1,2 delims=:" %%a in (file.txt) do echo %%a - %%b | findstr /l /i "%dom%"
echo.
echo.
pause
goto a
@echo off
for /f "tokens=1,2 delims=:" %%a in (file.txt) do echo %%a - %%b | findstr /l /i "DOMAIN_CHANGE_THIS_"
its all one line except @echo off that is in the first line
If you want something with user input
@echo off
:a
echo Enter Domain
set /p dom=
for /f "tokens=1,2 delims=:" %%a in (file.txt) do echo %%a - %%b | findstr /l /i "%dom%"
echo.
echo.
pause
goto a
Re: Batch File Search
hello, its me again.
now i have this issue.
i have file with mailling lists and it looks somethink like this.
list name@domain.tld
data1
data2
data3
data4
data5
.
.
.
data24
list name2@domain2.tld
Now I want to enter domain and find every list with this domain and print list name and all data to next list.
I this posible and have?
thanks again.
now i have this issue.
i have file with mailling lists and it looks somethink like this.
list name@domain.tld
data1
data2
data3
data4
data5
.
.
.
data24
list name2@domain2.tld
Now I want to enter domain and find every list with this domain and print list name and all data to next list.
I this posible and have?
thanks again.
Re: Batch File Search
can the domain name appear more than once?
Is "list" in column 1 actually part of the file?
Is "list" in column 1 actually part of the file?
Re: Batch File Search
yes, domain name appear more than once.
"list" is not a part of the file. its word which start every mailling list.
"list" is not a part of the file. its word which start every mailling list.
Re: Batch File Search
Without knowing the exact text to search for, this is all I can provide.
Download GnuSed and then use this batch file.
EDITED AGAIN:
Download GnuSed and then use this batch file.
EDITED AGAIN:
Code: Select all
@echo off
sed "/@domain.tld/,/^list/"!d "file.txt"