Extracting with FINDSTR

February 18, 2009 at 08:47:38
Specs: Windows XP
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! :(


See More: Extracting with FINDSTR

Report •


#1
February 18, 2009 at 09:15:50
Post a few lines of the files.


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

M2


Report •

#2
February 20, 2009 at 09:22:04
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 :(


Report •

#3
February 21, 2009 at 03:52:40
@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


Report •

Related Solutions

#4
February 21, 2009 at 21:27:05
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!

Report •

#5
February 21, 2009 at 23:09:04
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


Report •


Ask Question