Page 1 of 1
help for command
Posted: 30 Oct 2019 00:28
by Rajnishjc_27
Hi friends
i have unix shell command as below
egrep -v '^..,00|^..,69'
i need to convert into win batch script.
please help.
Re: help for command
Posted: 30 Oct 2019 02:44
by Rajnishjc_27
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
Re: help for command
Posted: 30 Oct 2019 06:47
by Aacini
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
Re: help for command
Posted: 30 Oct 2019 08:32
by Rajnishjc_27
please write batch script....
Re: help for command
Posted: 30 Oct 2019 08:38
by aGerman
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
Re: help for command
Posted: 31 Oct 2019 03:12
by Rajnishjc_27
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