experchange > scripting.jscript

big_jonne1_4me (03-29-14, 07:24 PM)
I need a standalone script to Read in a TextStream from a file and Write out every line to a new file.
However it must write only from the line beginning with UniqueString and stop at the line ending with OneOffString.

Any help would be appreciated, thank you.
Evertjan. (03-29-14, 08:45 PM)
big_jonne1_4me wrote on 29 mrt 2014 in
microsoft.public.scripting.jscript:

> I need a standalone script to Read in a TextStream from a file and Write
> out every line to a new file. However it must write only from the line
> beginning with UniqueString and stop at the line ending with
> OneOffString.
> Any help would be appreciated, thank you.


Standalone scripts do not function,
they are just text,
you need an engine to execute them.

I would suggest you hire a commercial programmer,
this NG is pretty much dead,
and on comp.lang.javascript most posters will only
help you if you try to programme yourself first.
big_jonne1_4me (03-30-14, 12:05 AM)
On Saturday, 29 March 2014 18:45:48 UTC, Evertjan. wrote:
> Standalone scripts do not function,
> they are just text,
> you need an engine to execute them.


I need a standalone script, not something integrated as part of a web page etc. It will be a .js file invoked by either a double click or from the commandline on a PC which will have the engine built in.

If you can't help then don't but I really do see no reason to make crazy suggestions and exacerbate the death of this group by alienating others.

I'm a .cmd file scripter, I need a .js scripter not a commercial programmer..

I could post what I've got so far, but it would be pointless, because all Icould provide would come directly from millions of on-line sources and wouldn't provide anyone here with anything of use to them. FileSystemObject, CreateTextFile, OpenTextFile ForReading, OpenTextFile ForWriting, Iterate through ReadFile line by line, If Regex Match UniqueString Then WriteLine, NextLine, If Not Regex Match Writeline Else Close Files.

All I need is some information on how to check the content of each line read, in order that I can output only those I require.
Evertjan. (03-30-14, 01:11 AM)
big_jonne1_4me wrote on 29 mrt 2014 in
microsoft.public.scripting.jscript:

> On Saturday, 29 March 2014 18:45:48 UTC, Evertjan. wrote:
> I need a standalone script, not something integrated as part of a web
> page etc. It will be a .js file invoked by either a double click or from
> the commandline on a PC which will have the engine built in.


You will need an engine, like cscript/wscript.

> If you can't help then don't but I really do see no reason to make crazy
> suggestions and exacerbate the death of this group by alienating others.


This group is dead, that is why I showed you the javascript one.

[..]
> Close Files.
> All I need is some information on how to check the content of each line
> read, in order that I can output only those I require.


Wel, you won't find it here, and not for free.
big_jonne1_4me (03-30-14, 01:54 PM)
On Saturday, 29 March 2014 23:11:08 UTC, Evertjan. wrote:
[..]
Evertjan. (03-30-14, 05:01 PM)
big_jonne1_4me wrote on 30 mrt 2014 in
microsoft.public.scripting.jscript:

> Anyone who believes that providing help, (read the topic title), or
> information to help me produce a script which satisfies my requirements
> is worthy of payment is an arse, I wonder what you believe?


Usenet is for discussion, providing help is optional and should not be
demanded.

I don't ask for paymant, I suggest you pay for services provided by a
professional programmer, which I am not.

Please do not use foul language.
Dr J R Stockton (03-30-14, 09:11 PM)
In microsoft.public.scripting.jscript message <XnsA3001E3D6836eejj99@194
..109.133.133>, Sun, 30 Mar 2014 00:11:08, Evertjan. <exxjxw.hannivoort@i
nter.nl.net> posted:

>This group is dead, that is why I showed you the javascript one.


How can that be, while you and I are here?
Evertjan. (03-31-14, 10:19 AM)
Dr J R Stockton <reply1400> wrote on 30 mrt 2014
in microsoft.public.scripting.jscript:

> In microsoft.public.scripting.jscript message <XnsA3001E3D6836eejj99@194
> .109.133.133>, Sun, 30 Mar 2014 00:11:08, Evertjan. <exxjxw.hannivoort@i
> nter.nl.net> posted:
>>This group is dead, that is why I showed you the javascript one.

> How can that be, while you and I are here?


Well John, we are dead too, perhaps.
At least, how could we measure we are not?

We could not know, if we are, like html, in a stateless protocol,
and jscript being fased out on the long forgotten lonely browser.

Even serverside jscript can only serve when called for.

Even the last straw, sorry law,
that of the speed of light being the limit of all speeds,
suffers from inflation.
Michael Bednarek (03-31-14, 10:57 AM)
On Sat, 29 Mar 2014 10:24:55 -0700 (PDT), big_jonne1_4me
wrote in microsoft.public.scripting.jscript:

>I need a standalone script to Read in a TextStream from a file and Write out every line to a new file.
>However it must write only from the line beginning with UniqueString and stop at the line ending with OneOffString.


I do something similar by using Instr() to determine the positions of
UniqueString (lngP1) and OneOffString (lngP2) and then output the wanted
text with Mid(strText, lngP1 + Len(UniqueString), lngP2). YMMV.
Evertjan. (03-31-14, 02:27 PM)
Michael Bednarek <mbATmbednarek.com> wrote on 31 mrt
2014 in microsoft.public.scripting.jscript:

> On Sat, 29 Mar 2014 10:24:55 -0700 (PDT), big_jonne1_4me
> wrote in microsoft.public.scripting.jscript:
> I do something similar by using Instr() to determine the positions of
> UniqueString (lngP1) and OneOffString (lngP2) and then output the wanted
> text with Mid(strText, lngP1 + Len(UniqueString), lngP2). YMMV.


But Instr() and Mid() is VBScript.

This NG is JScript as is the OQ, methinks,
in JScript you can use Regex to perform all such tasks.

var myStr = myStr.replace(/^a..a(bb)cc(c.{3}c)$/,'$2xxx$1yyy');

You could do this with VBS too,
but that looks awefull in VBS.
Similar Threads