Question 1)
I have var $a and want to split them by char or line break:
My $a contains f.ex.:
File1.txt
File2,txt
File3.txt
$array = Split($a,"\n")
msg $array(1)
new $array(1)
or
$b = X:\one\two\three\file4.txt
$array = Split($b,"\")
msg $array(0) . "..." . UBound($array)
How can i split such contents into parts?
Question 2)
How can i do an For..Next Statement ?
For Each Part in $a
doit
Next
or
For i = 1 TO UBound($array)
doit
i++
Next
-------
And an other thing i want to know
readfile(filename, [mode])
How can i do
$line = readfile(filename, LineNo(1))
or
For x = 1 TO EOF
$lineArray = readfile(filename, LineNo(x))
new file $lineArray(x)
x++
Next
?
THX for an answer ;-)
----
Edit:
f.ex. i want to script
Code: Select all
input $output, caption, , m;
msg $output;
$array = Split($output, NL);
For i = 1 To UpperBound($array)
new $array(i) ;
i = i + 1
Nextabereine.txt
aberzwei.txt
aber drei.txt
to create a few files there names i have copied from text file or an web side for testing issues.
(currently i use batch or ahk script, but want to do this with XY scripting if possible)
XYplorer Beta Club