Computing.Net > Forums > Programming > Extracting with FINDSTR

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Extracting with FINDSTR

Reply to Message Icon

Name: evil_hamburglar
Date: February 18, 2009 at 08:47:38 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

Hello,
I'm attempting to use FINDSTR to search for data contained within parenthesis of several files and then output them to a text file.
So far I've tried variations of the following:
FINDSTR [( - )] *.HTML | text.txt

Please help! :(



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: February 18, 2009 at 09:15:50 Pacific
Reply:

Post a few lines of the files.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: evil_hamburglar
Date: February 20, 2009 at 09:22:04 Pacific
Reply:

Hi,
Here are 3 of 800,000+ lines:

RandomCodeRandomCode('abc','a1')"MoreRandomCode;
RandomCodeRandomCode('123','a1')"MoreRandomCode;
RandomCodeRandomCode('xyz','b1')"MoreRandomCode;

I came across this snippet of code that I should put me on the right track if I can figure out what each snippet means...

FOR /F "tokens=2,3 delims= " %%A IN ('PING -a %1') DO IF "%%B"=="[%1]" SET PC=%%A

I know I need to replace PING with FINDSTR, but am not sure what to do from there :(


0

Response Number 3
Name: Mechanix2Go
Date: February 21, 2009 at 03:52:40 Pacific
Reply:

@echo off > newfile & setLocal EnableDelayedExpansion

for /f "tokens=2 delims=()" %%a in (myfile) do (
echo %%a >> newfile
)


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 4
Name: evil_hamburglar
Date: February 21, 2009 at 21:27:05 Pacific
Reply:

Mechanix, Please let me know if you prefer Starbucks or Jamba Juice! I've got one of each. It's the very least I can do to THANK YOU!


0

Response Number 5
Name: Mechanix2Go
Date: February 21, 2009 at 23:09:04 Pacific
Reply:

Never heard of Jamba Juice so I'll take my chances with SBUX. But I wouldn't buy their stock right now.

:(


=====================================
If at first you don't succeed, you're about average.

M2


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Extracting with FINDSTR

BATCH - set varible with findstr www.computing.net/answers/programming/batch-set-varible-with-findstr-/14944.html

Batch Find and Extract Regex String www.computing.net/answers/programming/batch-find-and-extract-regex-string/17028.html

Batch Question help with Findstr www.computing.net/answers/programming/batch-question-help-with-findstr/16018.html