Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

writing new line to text file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • writing new line to text file

    Hi guys,

    I have a form, when the user submits i want to write the line to the text file, but append not overwrite the data, however i want it appended on the next line.

    Current text file:
    my;name;is

    After adding i want:
    my;name;is
    new;name;is

    NOT
    my;name;isnew;name;is

    I assume i use the string append, but what character do i append to put the data on the nextline?

    Shawn

  • #2
    Hi. The TextFile.WriteFromString() action has an append option, would this be better suited to this task or am I misunderstanding?

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment


    • #3
      hi corey,

      yeah thats what im using, but it appends to the text, not a new line, do you know what im saying

      existing text

      once i append "newtext"

      this is what i get:
      existing textnewtext

      this is what i want
      existing text
      new text

      Comment


      • #4
        Hi. just add \r\n to your text... i.e.:

        "\r\n\Line to write to file here"

        That creates a new line in the text file...

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment


        • #5
          not working corey. Give me an error if i do 'r\n\' or "r\n\"

          in1 = Input.GetText("Input1");
          in2 = Input.GetText("Input2");
          in3 = Input.GetText("Input3");
          in4 = Input.GetText("Input4");
          result = String.Concat(in1, ";");
          result2 = String.Concat(result, in2);
          result = String.Concat(result2, ";");
          result3 = String.Concat(result, in3);
          result = String.Concat(result3, ";");
          result4 = String.Concat(result, in4);
          TextFile.WriteFromString("output.txt", result4, true);
          TextFile.WriteFromString("output.txt", 'r\n\', true);

          Error Detail: [unfinished string near `<eof>'] in [TextFile.WriteFromString("output.txt", 'r\n\', true);]

          Comment


          • #6
            nevermind i got it, thanks man

            Comment


            • #7
              NP. :

              Corey Milner
              Creative Director, Indigo Rose Software

              Comment

              Working...
              X