Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simple string search and replace question

36 views
Skip to first unread message

Don84

unread,
Jul 24, 2009, 11:30:56 AM7/24/09
to
Hi,

I have a short one line text file which includes double quotes and a
digit, e.g.
"1", or "0"
How do I get the digit or remove the quotes?

Thanks.

ten.n...@virgin.net

unread,
Jul 24, 2009, 11:53:19 AM7/24/09
to

::----- START -----
For /f "tokens=*" %%a In (PathTo\file.txt) Do @Echo/%%~a
::------ END ------

sw0rdfish

unread,
Jul 24, 2009, 12:08:59 PM7/24/09
to

you should , next time, try and start to write some code before
posting.

here's a vbscript

Set objFS = CreateObject("Scripting.FileSystemObject")
WScript.Echo Replace(objFS.OpenTextFile("c:\test
\file.txt").ReadAll,"""","")

sw0rdfish

unread,
Jul 24, 2009, 12:10:09 PM7/24/09
to

are you sure it works?

Don84

unread,
Jul 24, 2009, 12:19:59 PM7/24/09
to

It works perfectly on one XP sp3 box while I received "%%a was
unexpected at this time" on another XP sp3. Odd. thks, what could
cause that?

Timo Salmi

unread,
Jul 24, 2009, 2:22:11 PM7/24/09
to

34} How can I remove the quote characters from a line?
http://www.netikka.net/tsneti/info/tscmd034.htm

http://www.netikka.net/tsneti/info/tscmd152.htm#Chr

All the best, Timo

--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Hpage: http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm

Don84

unread,
Jul 24, 2009, 4:06:40 PM7/24/09
to
On Jul 24, 2:22 pm, Timo Salmi <t...@uwasa.fi> wrote:

> Don84 <tatata9...@gmail.com> wrote:
> > I have a short one line text file which includes double quotes and a
> > digit, e.g.
> > "1", or "0"
> > How do I get the digit or remove the quotes?
>
>   34} How can I remove the quote characters from a line?
>  http://www.netikka.net/tsneti/info/tscmd034.htm
>
>  http://www.netikka.net/tsneti/info/tscmd152.htm#Chr
>
>     All the best, Timo
>
> --
> Prof. Timo Salmi   mailto:t...@uwasa.fi    ftp &http://garbo.uwasa.fi/

> Hpage:http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
> Department of Accounting and Finance,   University of Vaasa,  Finland
> Useful CMD script trickshttp://www.netikka.net/tsneti/info/tscmd.htm

Thank you for helping me to resolve the problem.

Larry__Weiss

unread,
Jul 25, 2009, 9:26:53 AM7/25/09
to
Timo, I can't wait for the day that you add "PowerShell aided solutions" to your
webpages.

- Larry

Timo Salmi

unread,
Jul 25, 2009, 12:30:03 PM7/25/09
to
In article <-YCdnYGcuPiDlfbX...@posted.internetamerica>,

Larry__Weiss <l...@airmail.net> wrote:
> Timo, I can't wait for the day that you add "PowerShell aided solutions" to your
> webpages.

Not in the plans at the moment and probably not in the near future.
But in case someone does not know what that is about, see e.g.
http://www.microsoft.com/windowsserver2008/en/us/powershell-faq.aspx

0 new messages