Google SERP minus quotes

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mungurk
Posts: 4
Joined: 31 May 2009 23:43

Google SERP minus quotes

#1 Post by mungurk » 31 May 2009 23:52

Hello,
I have read through previous postings on stripping quotes, but cannot seem to get my batch to remove the quotes.

I have a script that prints a Google URL to a TXT file:

set str="http://www.google.com/search?hl=en&as_q=canada&as_epq=&as_oq=&as_eq=&num=100&lr=&as_filetype=pdf&ft=i&as_sitesearch=uc.edu&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=off"
echo.%str%
echo.%str% >> url.txt

Any suggestions how to strip out the quotes from the file url.txt

Thank you so much!

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 01 Jun 2009 11:37

How about:

echo.%str:"=%>>url.txt
Should work as long as str is defined. You could do this:

if defined str echo.%str:"=%>>url.txt

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#3 Post by avery_larry » 01 Jun 2009 11:47

Oops. Should have tested that. Try this instead:

Code: Select all

set str="http://www.google.com/search?hl=en&as_q=canada&as_epq=&as_oq=&as_eq=&num=100&lr=&as_filetype=pdf&ft=i&as_sitesearch=uc.edu&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=off"
echo.%str%
for /f %%a in (%str%) do echo.%%~a>>url.txt

mungurk
Posts: 4
Joined: 31 May 2009 23:43

Thanks so much for that help!!!

#4 Post by mungurk » 01 Jun 2009 14:29

avery_larry, Thank you so much for helping me with this one.
I just could not seem to get my head around it properly.

All the best...

Post Reply