Re: Finding Characters only in string of lines

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks,

John
"Jerold Schulman" <Jerry@xxxxxxxxxx> wrote in message
news:4lsrg15i36pbbpkvqeu5gr9psnpun7og9m@xxxxxxxxxx
> On Wed, 24 Aug 2005 08:21:10 -0700, "John"
<John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >I current have a batch script that executes a shell command which stdout
to
> >the Windows shell a string of characters.
> >
> >I capture the string of characters into a variable then write it into a
text
> >file.
> >
> >I would like to only capturer only a few characters that's in the
variable.
> >
> >Example would be anything that starts with # and ends in '
> >
> >In a nutshell I want to capture a number that is in the stdout of the
> >command.
> >
> >This number always increments as the script runs.
> >
> ># '243'
>
>
> @echo off
> setlocal ENABLEDELAYEDEXPANSION
> For /F "Tokens=*" %%a in ('YourCommand^|findstr /B /L /C:"# '"^|findstr /E
/L /C:"'"') do (
> set work=%%a
> set /a number=!work:~3,3!
> @echo !number!
> )
> endlocal


.



Relevant Pages

  • Re: Finding Characters only in string of lines
    ... >I current have a batch script that executes a shell command which stdout to ... >the Windows shell a string of characters. ... >I capture the string of characters into a variable then write it into a text ...
    (microsoft.public.windows.server.scripting)
  • Finding Characters only in string of lines
    ... I current have a batch script that executes a shell command which stdout to ... I capture the string of characters into a variable then write it into a text ...
    (microsoft.public.windows.server.scripting)
  • Re: showmatch script from Unix Power Tools gives error
    ... When run it is supposed to highlight the match on stdout with carets ... The awk program works by first setting "s" to be the characters before ... The reason for keeping certain characters in the "s" string is to ...
    (comp.unix.shell)
  • Re: Why does my program change the characters in my shell
    ... I hope you must be ending each string with NULL characters otherwise ... However, when it gets done puting the data on stdout, the program is ...
    (comp.unix.programmer)
  • Re: using dd to wipe a disk
    ... Peter wrote: ... rather that "yes" is an actual shell command that will repeatedly sent to STDOUT either "y" or alternatively it's command line argument ... So the backticks substitute the contents of the file random.seed, and then yes repeatedly outputs that string ... ...
    (uk.comp.os.linux)