Split for each line to file



  • Hello,
    I have text contain few lines. Example:

    Line1
    Line2
    Line3

    I would like to split text each line to an variable and save to file

    Line1 => file 1
    Line2 => file2
    Line3 => file3

    Just like that. I'm using GET string between
    .split("\n")[1] => This is comeback with Line0 and save to file 1 succeed

    But when i using Get string between Line 2 and Line 3 with

    .split("\n")[0]
    .split("\n")[2]

    The file 2 got all text except Line1
    Can anyone help me with this?

    Regard.



  • Use "Read file to list" action and you will
    get a list variable where each line will be
    list element. After that you can write file
    in a loop so each list element would become
    a new file.



  • How i can use that for get text from specific line 1, line 2.

    Line 1 ->Save to file1 . Read back and use
    Line 2 -> Save to file 2. Read back and use
    Line 3,4,5,6 Not need to save and not using

    Regard



  • Example i got specific text like this (NO1)
    Line1

    Line2

    Line3
    Line4
    Line5

    It's not like this (NO2)
    Line1
    Line2
    Line3
    Line4
    Line5

    And i would like to split from case 1 to case 2 and save Line1 and Line2 to specific file and use back in script

    Anyone can help?

    Regard


Log in to reply