Computing.Net > Forums > Programming > Batch file RegEx query

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.

Batch file RegEx query

Reply to Message Icon

Name: svkrec
Date: September 8, 2008 at 07:39:27 Pacific
OS: Win XP
CPU/Ram: P4/1GB
Product: Dell
Comment:

Hi,

I need help to write FINDSTR search string in batch program using regex.

I want to ignore all those lines that start with '(single quote) even if they contain FINDSTR search string. If the matching line does not start with '(single quote), I want that line in my output file.

I tried with something like this
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
For /F "tokens=1" %%A in (Input.txt) Do (
For /f "delims=" %%B in ('FINDSTR /S /I /R "^[^']"%%A *.vb') DO (
echo %%A, %%B >> sample.csv
)
)

Is above correct? Thanks,



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 8, 2008 at 10:26:38 Pacific
Reply:

findstr /b /v "'" < myfile > newfile


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

M2


0

Response Number 2
Name: svkrec
Date: September 8, 2008 at 10:55:59 Pacific
Reply:

I got the solution. I should use below to get desired output -
FINDSTR /S /I "^[^']*"%%A *.vb


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: Batch file RegEx query

batch file name date and time www.computing.net/answers/programming/batch-file-name-date-and-time/15060.html

Batch File www.computing.net/answers/programming/batch-file/12843.html

Batch file to copy the lines www.computing.net/answers/programming/batch-file-to-copy-the-lines/11114.html