Sign in to follow this  
Followers 0
qwertylol

combined file name - saving $var

5 posts in this topic

this is a loop

loop

{

save txt file in a file named file + $var + .txt with content of $data , which contains a string.

$var = $var + 1

}

how do I do this?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Use arrays?

Edited by Paulie

Share this post


Link to post
Share on other sites

I want to save txt string $data to a .txt file , how do I do it?

I want the .txt files to be named as 1.txt, 2.txt, 3.txt, 4.txt, 5.txt,

how do I do it?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Not tested as the pc I'm currently on doesn't have autoit or scite, but it's something like this.

$HowManyFiles = 5

$Data = "My Text File"

For $i = 1 To $HowManyFiles
   $FO = FileOpen(@ScriptDir & "\" & $Data & $i & ".txt", 1)
   FileWrite($FO, $Data & $i)
   FileClose($FO)
NextoÝ÷ ØêÚºÚ"µÍÌÍÒÝÓX[Q[ÈH
BÌÍÑ]HH  ][ÝÓ^H^[I][ÝÂÌÍÚHHB    ÌÍÑÈH[SÜ[ØÜ  [È ][ÝÉÌLÉ][ÝÈ   [È ÌÍÑ]H    [È ÌÍÚH [È ][ÝË  ][ÝËJB[UÜ]J  ÌÍÑË    ÌÍÑ]H    [È ÌÍÚJB[PÛÜÙJ   ÌÍÑÊB   ÌÍÚH
ÏHB[[  ÌÍÚHH    ÌÍÒÝÓX[Q[oÝ÷ ØêÚºÚ"µÍÌÍÒÝÓX[Q[ÈH
BÌÍÑ]HH  ][ÝÓ^H^[I][ÝÂÌÍÚHHBÚ[H
    ÌÍÚH ÏH ÌÍÒÝÓX[Q[ÊB   ÌÍÑÈH[[ØÜ  [È ][ÝÉÌLÉ][ÝÈ   [È ÌÍÑ]H    [È ÌÍÚH [È ][ÝË  ][ÝËJB[]J  ÌÍÑË    ÌÍÑ]H    [È ÌÍÚJB[PÛÜÙJ   ÌÍÑÊB   ÌÍÚH
ÏHHÑ[

Cheers

Edit: typo's

Edited by smashly

Share this post


Link to post
Share on other sites

thank you !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0