<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Найти цифры между 2-мя символами]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10018&amp;type=atom" />
	<updated>2014-10-03T04:59:45Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10018</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86979#p86979" />
			<content type="html"><![CDATA[<p><strong>Xameleon</strong>, <strong>alexii</strong><br />Понятно. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2014-10-03T04:59:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86979#p86979</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86975#p86975" />
			<content type="html"><![CDATA[<p><strong>greg zakharov</strong>, это у нас обычное дело — «я уже придумал решение, теперь сделайте мне его», т.е. решаем не задачу, а решение, сложившееся в голове у автора <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" />.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2014-10-02T22:31:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86975#p86975</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86973#p86973" />
			<content type="html"><![CDATA[<p><strong>greg zakharov</strong><br /></p><div class="quotebox"><cite>greg zakharov пишет:</cite><blockquote><p>Уж это, надеюсь, сможете додумать?! Если нет, боюсь, что Вам поможет только самостоятельное изучение WSH.</p></blockquote></div><p>В довесок к Вашим словам. <span class="postimg"><img src="http://vk.com/images/stickers/103/128.png" alt="http://vk.com/images/stickers/103/128.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2014-10-02T20:07:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86973#p86973</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86972#p86972" />
			<content type="html"><![CDATA[<p><strong>Xameleon</strong><br /><span class="postimg"><img src="https://vk.com/images/stickers/104/128.png" alt="https://vk.com/images/stickers/104/128.png" /></span><br />Простите, Вы о чем?</p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2014-10-02T19:45:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86972#p86972</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86966#p86966" />
			<content type="html"><![CDATA[<p>OFFTOP:</p><p><strong>greg zakharov</strong>,</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p><span class="postimg"><img src="http://risovach.ru/upload/2014/02/mem/frai-v-panike_42912625_orig_.jpeg" alt="http://risovach.ru/upload/2014/02/mem/frai-v-panike_42912625_orig_.jpeg" /></span></p></div></div><p>P.S Представил себе ситуацию, если бы так поступали программисты, создающие ПО для управления атомными реакторами.<br />А потом работники АС в этом ПО тыкали бы все кнопки подряд - авось сработает. Я конечно тоже многое делаю методом проб и ошибок, но всё-таки для получения базовых знаний [ПМСМ], лучше почитать литературу.</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2014-10-02T17:10:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86966#p86966</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86963#p86963" />
			<content type="html"><![CDATA[<p>Ну <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /> скопировал ваш код в папку, поменял название из Запуск.bat в bat.bat как у вас, запустил и вылезла вот такая ошибка <a href="http://gyazo.com/9d8f863f0ed268ac8b3a2b09bff29813">http://gyazo.com/9d8f863f0ed268ac8b3a2b09bff29813</a></p>]]></content>
			<author>
				<name><![CDATA[DarkJoker1992]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32574</uri>
			</author>
			<updated>2014-10-02T16:21:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86963#p86963</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86962#p86962" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>(function() {
  with (new ActiveXObject(&#039;WScript.Shell&#039;)) {
    var top = ExpandEnvironmentStrings(&#039;%programfiles%\\1C\\&#039;),
        log = top + &#039;log.txt&#039;,
        bat = top + &#039;bat.bat&#039;,
        str, raw;
    
    with (new ActiveXObject(&#039;Scripting.FileSystemObject&#039;)) {
      if (!FileExists(log)) {
        WScript.echo(&quot;Error: file does not exists.&quot;);
        WScript.Quit(1);
      }
      
      str = OpenTextFile(log);
      raw = str.ReadAll();
      str.Close();
    }
    
    if (/(?!\**\=)\d+(?!=m)/i.exec(raw) !== null) {
      //WScript.echo(&quot;Если есть цифра&quot;);
      Run(bat);
    }
    else {
      WScript.echo(&quot;Если нет цифр&quot;);
    }
  }
}());</code></pre></div><p>Уж это, надеюсь, сможете додумать?! Если нет, боюсь, что Вам поможет только самостоятельное изучение WSH.</p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2014-10-02T15:50:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86962#p86962</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86961#p86961" />
			<content type="html"><![CDATA[<p>Ребят подскажите чё я не так сделал, пришлось чуток код переделать для удобности использования. </p><div class="codebox"><pre><code>Option Explicit

Dim strSourceFile
Dim strContent

Dim WshShell,objFSO

   Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
   set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
   otchet = .ExpandEnvironmentStrings(&quot;%programfiles%&quot;)
   
strSourceFile = (otchet &amp; &quot;\1C\log.txt&quot;)

Set objFSO = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)

If objFSO.FileExists(strSourceFile) Then
    With objFSO.OpenTextFile(strSourceFile)
        strContent = .ReadAll()
        .Close
    End With
    
    With WScript.CreateObject(&quot;VBScript.RegExp&quot;)
        .Pattern = &quot;=M&quot;
        
        If .Test(strContent) Then
                WScript.Echo &quot;Найдена ошибка&quot;
                WshShell.Run (otchet &amp; &quot;\1С\Запуск.bat&quot;), ,true
        Else
          WScript.Echo &quot;Отчёт успешно сформирован&quot;
                   WScript.Quit 1
        End If
    End With
Else

End If

Set objFSO = Nothing

WScript.Quit 0</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DarkJoker1992]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32574</uri>
			</author>
			<updated>2014-10-02T15:19:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86961#p86961</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86960#p86960" />
			<content type="html"><![CDATA[<p>Еще раз... все гораздо проще.<br /></p><div class="codebox"><pre><code>(function() {
  var str1 = &#039;****.=125M&#039;,
      str2 = &#039;*********.=M&#039;,
      reg  = /(?!\**\=)\d+(?!=m)/i,
      res1 = reg.exec(str1),
      res2 = reg.exec(str2);
  WScript.echo(&quot;res1: &quot; + res1 + &quot;; res2: &quot; + res2);
}());</code></pre></div><p>В случае с res1 получим число, с res2 - null. Моя идея в том, чтобы &quot;забирать&quot; число между знаков, а если такого нет, то возвращать null.</p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2014-10-02T14:29:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86960#p86960</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86959#p86959" />
			<content type="html"><![CDATA[<p>Спасибо,думаю это то что мне нужно. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[DarkJoker1992]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32574</uri>
			</author>
			<updated>2014-10-02T12:30:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86959#p86959</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86958#p86958" />
			<content type="html"><![CDATA[<p><span style="color: Green">Избегайте излишнего цитирования. Я поправил Ваш пост.</span></p><div class="quotebox"><blockquote><p>Вот прошу ссылка http://rghost.ru/private/58314573/9c215 … 1f2a327e2a</p></blockquote></div><div class="codebox"><pre><code>Option Explicit

Dim strSourceFile

Dim objFSO
Dim strContent


strSourceFile = &quot;E:\Песочница\0399\тест.txt&quot;

Set objFSO = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)

If objFSO.FileExists(strSourceFile) Then
    With objFSO.OpenTextFile(strSourceFile)
        strContent = .ReadAll()
        .Close
    End With
    
    With WScript.CreateObject(&quot;VBScript.RegExp&quot;)
        .Pattern = &quot;=M&quot;
        
        If .Test(strContent) Then
            WScript.Echo &quot;Nothing found between [=] and [M] in [&quot; &amp; strContent &amp; &quot;].&quot;
        Else
            WScript.Echo &quot;Somthing found between [=] and [M] or not found [=] and [M] in [&quot; &amp; strContent &amp; &quot;].&quot;
        End If
    End With
Else
    WScript.Echo &quot;Can&#039;t find source file [&quot; &amp; strSourceFile &amp; &quot;].&quot;
    WScript.Quit 1
End If

Set objFSO = Nothing

WScript.Quit 0</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2014-10-02T12:19:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86958#p86958</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86957#p86957" />
			<content type="html"><![CDATA[<p>Вот прошу ссылка <a href="http://rghost.ru/private/58314573/9c2158c98e3e35b3e9907d1f2a327e2a">http://rghost.ru/private/58314573/9c215 … 1f2a327e2a</a></p>]]></content>
			<author>
				<name><![CDATA[DarkJoker1992]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32574</uri>
			</author>
			<updated>2014-10-02T11:54:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86957#p86957</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86955#p86955" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>эммм -_- простите, а где указать файл для обработки?</p></blockquote></div><p>Пока нигде. Вы ведь не выложили образец файла.</p><div class="quotebox"><blockquote><p>+ вы поставили числа strSample = &quot;(*****.=12415M)&quot; но имеется ввиду что числа между = и М каждый раз разные могут быть.</p></blockquote></div><p>Проставьте в примере разные Ваши числа вместо «12415» в «strSample = &quot;(*****.=12415M)&quot;» и проверьте. Вы путаете шаблон («.Pattern») и примеры строк в «strSample». Поскольку Вы не выложили файл — откуда мне знать, что там может или не может быть в реальности?!</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2014-10-02T11:37:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86955#p86955</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86954#p86954" />
			<content type="html"><![CDATA[<p>эммм -_- простите, а где указать файл для обработки? + вы поставили числа strSample = &quot;(*****.=12415M)&quot; но имеется ввиду что числа между = и М каждый раз разные могут быть.</p>]]></content>
			<author>
				<name><![CDATA[DarkJoker1992]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32574</uri>
			</author>
			<updated>2014-10-02T11:14:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86954#p86954</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Найти цифры между 2-мя символами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=86953#p86953" />
			<content type="html"><![CDATA[<p>Ну так в файле всего 2 записи, вот эта&nbsp; номер.=числоM<br />и ещё одна оч важная личная информация.<br />Спасибо за код, сегодня испробую и напишу что да как вышло. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[DarkJoker1992]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32574</uri>
			</author>
			<updated>2014-10-02T10:48:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=86953#p86953</id>
		</entry>
</feed>
