Thanks Pegasus for your help. I will change the alias name so that they will not
conflict with anything. I will add a X to all the alias. That way i don't have
to remember them again.
--
Ayush [ Be ''?'' Happy ]
For any query, search -
www.Google.com
Want to know about a term -
http://en.wikipedia.org
Replied To :
-------------------------------------------------------------
| This is not a "bug" as you like to call it but is the direct result
| of your lack of functional specification that I keep mentioning.
| It's often called "scope creep".
|
| You're a programmer. Use a further "find" pipe to suppress
| lines that include the string "*ms"! (if that's what you want,
| which I'm not sure at all).
|
|
|
| "Ayush" <ayushmaan.j[aatt]gmail.com> wrote in message
| | > Thanks for your patience and support. That worked but still there is a bug
| in it
| > that whenever it founds the text (parameter), it opens that website. I
| tested
| > the alias "ms" and it opened every occurrence of ms. It opened these
| sites:
| >
http://3d2f.com/programs/1-131-totalsize-download.shtml
| > *ms in programs
| > ms
http://www.microsoft.com/
| > *ms in ms
| > msq
|
http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=query
| > *ms in msq
| >
| > Can you modified the script so that it will not open any ms that is not
| > separate.Example: programs.
| > --
| > Ayush [ Be ''?'' Happy ]
| >
| > For any query, search -
www.Google.com
| > Want to know about a term -
http://en.wikipedia.org
| >
| > Replied To :
| > -------------------------------------------------------------
| >
| > | > |
| > | "Ayush" <ayushmaan.j[aatt]gmail.com> wrote in message
| > | | > | >
| > | >
| > | >
| > | > Replied To :
| > | > -------------------------------------------------------------
| > | >
| > | > | > | > |
| > | > | "Ayush" <ayushmaan.j[aatt]gmail.com> wrote in message
| > | > | | > | > | >
| > | > | >
| > | > | > Replied To :
| > | > | > -------------------------------------------------------------
| > | > | >
| > | > | > | > | > | > I am thinking of using "if" command for converting aliases in
| urls.
| > | > | >
| > | > | > | > | No problem reading a line from a text file:
| > | > | > | > |
| > | > | > | > | for /f %%a in (c:\url.txt) do set url=%%a
| > | > | > | > | start /b "FireFox" "C:\program files\Mozilla
| > | firefox\firefox.exe"
| > | > | > |
www.%url%
| > | > | > | >
| > | > | > | > I have lots of aliases and urls in a single text file. This
| script
| > | > | sets
| > | > | > | the
| > | > | > | > variable URL to the last line in the text file.
| > | > | > | > I have aliases and urls in this format :
| > | > | > | > alias<SPACE>URL
| > | > | >
| > | > | > | >
| > | > | > |
| > | > | >
| > | > |
| > | >
| > |
| >
|
http://www.softpedia.com/get/Authoring-tools/Setup-creators/Nullsoft-Installation-System.shtml
| > | > | > | > jok
http://www.jokefile.co.uk
| > | > | > | > AND Can you tell me what actually the for loop is doing ? I
| try to
| > | > | know
| > | > | > | from for
| > | > | > | > /? but cant get it.
| > | > | > | > --
| > | > | > | > Ayush [ Be ''?'' Happy ]
| > | > | > | >
| > | > | > | >
| > | > | > |
| > | > | > | To avoid guessing games, it is best to do this ***before***
| posting:
| > | > | > | 1. Think about your exact requirements (or the nature of the
| > | problem).
| > | > | > | 2. Put it all into the post.
| > | > | > |
| > | > | >
| > | > | >
| > | > | > Sorry about that, i think that was not needed.
| > | > | >
| > | > | >
| > | > | >
| > | > | >
| > | > | > | In your case I ***guess*** that this is what you wish to do do:
| > | > | > | 1. Prompt the user for a keyword, e.g. "jokes".
| > | > | > | 2. Scan a list of URLs for this keyword.
| > | > | > | 3. Extract the appropriate line from the list.
| > | > | > | 4. Launch the selected web page.
| > | > | > | So far you have alluded to this type of action but you
| > | > | > | never actually spelt it out. Is this what you require?
| > | > | >
| > | > | > First, i don't know how to do the above and don't want to do.
| > | > | > I want to take the parameter > then search for that in the text
| file >
| > | If
| > | > | found
| > | > | > then open the browser by giving the URL for the alias.
| > | > | > Now the main question is : Can this be done from script ? I mean :
| > | find
| > | > | the text
| > | > | > > then retrieve the url after the text and space and before the
| new
| > | line.
| > | > | >
| > | > | > --
| > | > | > Ayush [ Be ''?'' Happy ]
| > | > | >
| > | > | >
| > | > |
| > | > | Where does the parameter come from? In the absence of detailed
| > | > | information, here is the raw batch file. It's just two lines long.
| Don't
| > | > | add or omit any single or double quotes or other special characters
| > | > | unless you know exactly what you're doing.
| > | >
| > | > The parameter will come from the address toolbar. I will type like
| this :
| > | > z <alias as a parameter>
| > | >
| > | >
| > | > |
| > | > | @echo off
| > | > | for /F "tokens=2" %%a in ('type url.txt ^| find /i "SomeParameter"')
| do
| > | > | start /b "FireFox" "C:\program files\Mozilla firefox\firefox.exe"
| "%%a"
| > | >
| > | > That script just flashes for a second. I placed a the file in the
| > | directory
| > | > where this script is located and renamed it to url.txt but the script
| just
| > | > flashes away. I changed the SomeParameter to a text that is in the
| text
| > | file but
| > | > it just flashes away. It doesn't even open FireFox.
| > | >
| > | >
| > | >
| > | > --
| > | > Ayush [ Be ''?'' Happy ]
| > | >
| > | >
| > |
| > | 1. Paste these two lines into c:\test.bat:
| > | @echo off
| > | for /F "tokens=2" %%a in ('type c:\url.txt ^| find /i "%1"') do start /b
| > | "FireFox" "C:\program files\Mozilla firefox\firefox.exe" "%%a"
| > |
| > |
| > | 2. Paste the following lines into c:\url.txt:
| > | g3
http://kgiii.info/windows/XP.html
| > | gamess
http://www.dodge.com/games/
| > | gcardd
http://www.123greetings.com/
| > | gl
www.google.com
| > | gla
http://www.google.co.in/advanced_search?hl=en
| > | goodiess
http://www.filehungry.com/english/showcase/Windows_Software
| > | grantr
http://www.us.playstation.com/Content/OGS/SCUS-97328/Site/
| > | greatts
http://3d2f.com/programs/1-131-totalsize-download.shtml
| > | helperr
| > |
| >
|
http://www.theglobeandmail.com/serv...ktoptrouble/BNStory/Technology/Troubleshooter
| > | helplinee
http://blogs.chron.com/helpline/
| > | hlpn
http://www.microsoft.com/wn3/locales/help/help_en-us.htm
| > | inline
| > |
| >
|
http://www.softpedia.com/get/Authoring-tools/Setup-creators/Nullsoft-Installation-System.shtml
| > | jok
http://www.jokefile.co.uk
| > | jokeess
http://ixpats.com/bestoftheweb/
| > | mmm
http://www.actualtools.com/products/index.php#aim
| > | movy
http://www.adlabscinemas.com/
| >
| > |
| > | 3. Start a Command Prompt.
| > |
| > | 4. Type this command:
| > | c:\test.bat jokeess
| > |
| > | You will now see that the batch file works very well. Since you
| > | were reluctant to fully define your project when I suggested you
| > | should, I will leave it up to you to interface it with whatever you
| > | wish to interface it with.
| > |
| > | Have a look at your original question, then gauge for yourself
| > | how little your current requirements have in common with that
| > | initial question. This is why I asked for a well-thought out
| > | specification - which is the first step in any programming effort!
| > |
| > |
| >
| >
|
|