String manipulation

Discussion in 'Javascript' started by Evertjan., Oct 26, 2006.

  1. Evertjan.

    Evertjan. Guest

    Andy McNamara wrote on 27 okt 2006 in comp.lang.javascript:

    > Very simple questions,


    Not for me, see below, Andy.

    > I have some data of strings, say, str1,sting2,stringstring3,etc


    What is/are "data of strings"?

    Are "str1, sting2, stringstring3" names of string [sting?] variables?

    > I also have a text file that needs to be filled upat some empty places,


    How can a text file have empty places?

    A textfile being/containing a string of characters.

    > I need to do this in javascript,


    Why do you need to do that in javascript?

    > could you help me with some apis that


    What are apis?

    > can do this ?


    Do what?

    > I am completely new to javascript. any help is appreciated.


    We all were at some point in time.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Oct 26, 2006
    #1
    1. Advertising

  2. Evertjan.

    ASM Guest

    Andy McNamara a écrit :
    > Very simple questions,
    > I have some data of strings, say, str1,sting2,stringstring3,etc
    > I also have a text file that needs to be filled upat some empty places,
    > I need to do this in javascript, could you help me with some apis that
    > can do this ? I am completely new to javascript. any help is appreciated.


    JavaScript can't write in a file.

    You'l have to ask that to PHP for instance.

    (eventually using XMLHttpRequest javascript function)
    ASM, Oct 26, 2006
    #2
    1. Advertising

  3. Evertjan.

    Evertjan. Guest

    ASM wrote on 26 okt 2006 in comp.lang.javascript:

    > Andy McNamara a écrit :
    >> Very simple questions,
    >> I have some data of strings, say, str1,sting2,stringstring3,etc
    >> I also have a text file that needs to be filled upat some empty
    >> places, I need to do this in javascript, could you help me with some
    >> apis that can do this ? I am completely new to javascript. any help
    >> is appreciated.

    >
    > JavaScript can't write in a file.
    > You'l have to ask that to PHP for instance.


    Javascript can write a file just as well as php,
    both as serverside code.

    Javascript can use Scripting.FileSystemObject

    Javascript in wscript or cscript can too.

    > (eventually using XMLHttpRequest javascript function)


    Eventually? Oh, as part of Ajax?

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Oct 26, 2006
    #3
  4. Evertjan.

    ASM Guest

    Evertjan. a écrit :
    >
    > Javascript can write a file just as well as php,
    > both as serverside code.
    >
    > Javascript can use Scripting.FileSystemObject


    can you give me an example ?
    ASM, Oct 26, 2006
    #4
  5. Evertjan.

    Evertjan. Guest

    ASM wrote on 26 okt 2006 in comp.lang.javascript:

    > Evertjan. a écrit :
    >>
    >> Javascript can write a file just as well as php,
    >> both as serverside code.
    >>
    >> Javascript can use Scripting.FileSystemObject

    >
    > can you give me an example ?


    Under classic ASP:

    <script language='jscript' runat='server'>

    var fso, tf;
    fso = new ActiveXObject('Scripting.FileSystemObject');
    tf = fso.CreateTextFile(Server.MapPath('/myDir/myfile.txt'), true);

    // Write a line with a newline character.
    tf.WriteLine('Testing 1, 2, 3.') ;

    // Write three newline characters to the file.
    tf.WriteBlankLines(3) ;

    // Write a text.
    tf.Write ('This is a test.');
    tf.Close();

    </script>

    not tested

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Oct 26, 2006
    #5
  6. Evertjan.

    ASM Guest

    Evertjan. a écrit :
    > ASM wrote on 26 okt 2006 in comp.lang.javascript:
    >
    >> Evertjan. a écrit :
    >>> Javascript can write a file just as well as php,
    >>> both as serverside code.
    >>>
    >>> Javascript can use Scripting.FileSystemObject

    >> can you give me an example ?

    >
    > Under classic ASP:


    would that work in my FireFox ?

    I undersdand it is server-side script.

    If it is :
    - would that work in my Apache ?
    - if not what javascript script could I use
    (with an example it is better for my poor mind)

    MapPath() is a generic function ? (to say : localhost)

    > <script language='jscript' runat='server'>
    >
    > var fso, tf;
    > fso = new ActiveXObject('Scripting.FileSystemObject');
    > tf = fso.CreateTextFile(Server.MapPath('/myDir/myfile.txt'), true);
    >
    > // Write a line with a newline character.
    > tf.WriteLine('Testing 1, 2, 3.') ;
    >
    > // Write three newline characters to the file.
    > tf.WriteBlankLines(3) ;
    >
    > // Write a text.
    > tf.Write ('This is a test.');
    > tf.Close();
    >
    > </script>
    >
    > not tested
    ASM, Oct 26, 2006
    #6
  7. Evertjan.

    Evertjan. Guest

    ASM wrote on 26 okt 2006 in comp.lang.javascript:

    > Evertjan. a écrit :
    >> ASM wrote on 26 okt 2006 in comp.lang.javascript:
    >>
    >>> Evertjan. a écrit :
    >>>> Javascript can write a file just as well as php,
    >>>> both as serverside code.
    >>>>
    >>>> Javascript can use Scripting.FileSystemObject
    >>> can you give me an example ?

    >>
    >> Under classic ASP:


    Read up about ASP.

    >
    > would that work in my FireFox ?
    >
    > I undersdand it is server-side script.
    >
    > If it is :
    > - would that work in my Apache ?
    > - if not what javascript script could I use
    > (with an example it is better for my poor mind)
    >
    > MapPath() is a generic function ? (to say : localhost)
    >
    >> <script language='jscript' runat='server'>
    >>
    >> var fso, tf;
    >> fso = new ActiveXObject('Scripting.FileSystemObject');
    >> tf = fso.CreateTextFile(Server.MapPath('/myDir/myfile.txt'), true);
    >>
    >> // Write a line with a newline character.
    >> tf.WriteLine('Testing 1, 2, 3.') ;
    >>
    >> // Write three newline characters to the file.
    >> tf.WriteBlankLines(3) ;
    >>
    >> // Write a text.
    >> tf.Write ('This is a test.');
    >> tf.Close();
    >>
    >> </script>
    >>
    >> not tested

    >
    >




    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Oct 26, 2006
    #7
  8. Evertjan.

    ASM Guest

    Evertjan. a écrit :
    > ASM wrote on 26 okt 2006 in comp.lang.javascript:
    >
    >> Evertjan. a écrit :
    >>> ASM wrote on 26 okt 2006 in comp.lang.javascript:
    >>>
    >>>> Evertjan. a écrit :
    >>>>> Javascript can write a file just as well as php,
    >>>>> both as serverside code.
    >>>>>
    >>>>> Javascript can use Scripting.FileSystemObject
    >>>> can you give me an example ?
    >>> Under classic ASP:

    >
    > Read up about ASP.


    thank you.
    ASM, Oct 26, 2006
    #8
  9. In message <45411695$0$25955$>, Thu, 26 Oct 2006
    22:12:05, ASM <> writes
    >Andy McNamara a écrit :
    >> Very simple questions,
    >> I have some data of strings, say, str1,sting2,stringstring3,etc
    >> I also have a text file that needs to be filled upat some empty places,
    >> I need to do this in javascript, could you help me with some apis
    >>that can do this ? I am completely new to javascript. any help is
    >>appreciated.

    >
    >JavaScript can't write in a file.
    >
    >You'l have to ask that to PHP for instance.
    >
    >(eventually using XMLHttpRequest javascript function)


    <FAQENTRY>, somewhere around 2.2 - I suggest a short section/paragraph
    along the general lines of :

    Javascript is a general term covering very similar languages used in
    differing environments, including client-side Web (the default
    assumption in c.l.j), server-side Web (on-topic in c.l.j), and Windows
    programming (CScript, WScript, for which news:microsoft.* is preferred).
    (any other environments?)


    It's a good idea to read the newsgroup and its FAQ. See below.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
    <URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
    <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
    <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
    Dr J R Stockton, Oct 27, 2006
    #9
  10. Evertjan.

    Randy Webb Guest

    ASM said the following on 10/26/2006 4:12 PM:
    > Andy McNamara a écrit :
    >> Very simple questions,
    >> I have some data of strings, say, str1,sting2,stringstring3,etc
    >> I also have a text file that needs to be filled upat some empty places,
    >> I need to do this in javascript, could you help me with some apis that
    >> can do this ? I am completely new to javascript. any help is appreciated.

    >
    > JavaScript can't write in a file.


    FSO in IE can!

    JScript in ASP can.

    Perhaps you meant "Javascript in a default security environment on a web
    page can't write a file on the local hard drive".

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Oct 27, 2006
    #10
  11. Very simple questions,
    I have some data of strings, say, str1,sting2,stringstring3,etc
    I also have a text file that needs to be filled upat some empty places,
    I need to do this in javascript, could you help me with some apis that
    can do this ? I am completely new to javascript. any help is appreciated.
    Andy McNamara, Oct 27, 2006
    #11
  12. Hi,

    ASM wrote:
    > Evertjan. a écrit :
    >> ASM wrote on 26 okt 2006 in comp.lang.javascript:
    >>
    >>> Evertjan. a écrit :
    >>>> ASM wrote on 26 okt 2006 in comp.lang.javascript:
    >>>>
    >>>>> Evertjan. a écrit :
    >>>>>> Javascript can write a file just as well as php,
    >>>>>> both as serverside code.
    >>>>>>
    >>>>>> Javascript can use Scripting.FileSystemObject
    >>>>> can you give me an example ?
    >>>> Under classic ASP:

    >>
    >> Read up about ASP.

    >
    > thank you.


    Actually, forget ASP and read about ASP.NET ;-)

    Just kidding. It's true that using JavaScript on ASP to program both the
    client and the server was kind of neat. But I wouldn't go back from .NET.

    About saving files: Client-side JavaScript running in a browser can do
    that too, but it needs the right permissions.

    See this
    http://www.galasoft-lb.ch/myjavascript/CExplorer/index.html

    This feature allows, for example, to write HTA (HTML Applications)
    running in IE but having the same permissions as a standalone
    application. Think of it as having the ease of a VBA application, but
    without having to touch VB (yuk).

    HTH,
    Laurent
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    PhotoAlbum: http://www.galasoft-LB.ch/pictures
    Support children in Calcutta: http://www.calcutta-espoir.ch
    Laurent Bugnion, Oct 28, 2006
    #12
  13. Evertjan.

    ASM Guest

    Laurent Bugnion a écrit :
    > Hi,


    Salut,

    > See this
    > http://www.galasoft-lb.ch/myjavascript/CExplorer/index.html


    I've been
    I'll look at home (locally)

    > This feature allows, for example, to write HTA (HTML Applications)
    > running in IE but having the same permissions as a standalone
    > application. Think of it as having the ease of a VBA application, but
    > without having to touch VB (yuk).


    Unlovely, on my Mac I use any M$ possibilities,
    (vb vba vscript hta htc are not for me and anyway of no use)
    I'm not more advanced
    (et avec Apache sur mon Mac de quoi je dispose?)

    > HTH,


    that could :)

    Stephane
    ASM, Oct 28, 2006
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jared in ecs

    Perl string manipulation

    jared in ecs, Oct 22, 2003, in forum: Perl
    Replies:
    2
    Views:
    792
    Roy Johnson
    Oct 22, 2003
  2. Garfield

    String Array Manipulation Problem

    Garfield, Aug 27, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    2,790
    Michael Lang
    Aug 27, 2003
  3. Aaron

    String Manipulation

    Aaron, Dec 31, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,599
    Dave Davidson
    Dec 31, 2003
  4. Aaron

    Advanced String Manipulation (C#)

    Aaron, Jan 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    798
  5. Chris

    String manipulation

    Chris, May 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    434
    Pete Wright
    May 24, 2004
Loading...

Share This Page