help for command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Rajnishjc_27
Posts: 21
Joined: 16 Aug 2019 23:35

help for command

#1 Post by Rajnishjc_27 » 30 Oct 2019 00:28

Hi friends

i have unix shell command as below

egrep -v '^..,00|^..,69'

i need to convert into win batch script.

please help.

Rajnishjc_27
Posts: 21
Joined: 16 Aug 2019 23:35

Re: help for command

#2 Post by Rajnishjc_27 » 30 Oct 2019 02:44

to more understand

i have file test.txt , and data as below in file.

id,pin,call
1,2,1212
2,3,12121

now i have unix command as below, which i want to convert into batch script

egrep -v '^..,00|^..,12' test.txt

Aacini
Expert
Posts: 1885
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: help for command

#3 Post by Aacini » 30 Oct 2019 06:47

So your question is intended just for people that know Unix, right?

Sorry, but I don't know Unix. Perhaps if I could see what is the result you want, I could write a Batch script for that...

Or you may post this request on a Unix forum.

Antonio

Rajnishjc_27
Posts: 21
Joined: 16 Aug 2019 23:35

Re: help for command

#4 Post by Rajnishjc_27 » 30 Oct 2019 08:32

please write batch script....

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: help for command

#5 Post by aGerman » 30 Oct 2019 08:38

The way I understand the pattern is quite similar to the findstr syntax.
-v reverse the meaning of the pattern (like /v for findstr)
^ match the beginning of the line
.. wildcards for two characters
,00 literally matched

So I guess in Batch it would be

Code: Select all

findstr /v "^..,00 ^..,12" "test.txt"
The output for test.txt with the following content …

Code: Select all

id,pin,call
1,2,1212
2,3,12121
3,12,1212
44,12,1212
5,00,1212
67,00,1212
... would be ...

Code: Select all

id,pin,call
1,2,1212
2,3,12121
3,12,1212
5,00,1212
please write batch script....
No! You have to explain what the unix command does for people that are not familiar with unix. How should we know? All I did above is guessing.

Steffen

Rajnishjc_27
Posts: 21
Joined: 16 Aug 2019 23:35

Re: help for command

#6 Post by Rajnishjc_27 » 31 Oct 2019 03:12

Thanks aGerman
aGerman wrote:
30 Oct 2019 08:38
The way I understand the pattern is quite similar to the findstr syntax.
-v reverse the meaning of the pattern (like /v for findstr)
^ match the beginning of the line
.. wildcards for two characters
,00 literally matched

So I guess in Batch it would be

Code: Select all

findstr /v "^..,00 ^..,12" "test.txt"
The output for test.txt with the following content …

Code: Select all

id,pin,call
1,2,1212
2,3,12121
3,12,1212
44,12,1212
5,00,1212
67,00,1212
... would be ...

Code: Select all

id,pin,call
1,2,1212
2,3,12121
3,12,1212
5,00,1212
please write batch script....
No! You have to explain what the unix command does for people that are not familiar with unix. How should we know? All I did above is guessing.

Steffen

Post Reply