vin1 Posted September 11, 2016 Posted September 11, 2016 I have this script that gives an error, how to fix it? #include <File.au3> $file = @DesktopDir & "\temp.txt" $file_output = @DesktopDir & "\output.txt" Local $array[1] _FileReadToArray($file, $array) $hOutput = FileOpen($file_output, 2) $iMultiplier = 3 Global $aTemp, $Text For $i = 1 To $array[0] $aTemp = StringSplit($array[$i], @TAB) If Not Mod($i, 50) Then $iMultiplier += 1 $text = "" For $j = 1 To $aTemp[0] $text &= $aTemp[$j] * $iMultiplier & @TAB Next $text = StringTrimRight($text, 1) FileWriteLine($hOutput, $text) Next FileClose($hOutput)
Moderators JLogan3o13 Posted September 11, 2016 Moderators Posted September 11, 2016 @vin1 in the future, do not hijack other people's threads, please. As to your code, do an _ArrayDisplay on your array after the _FileReadToArray call. Is the value for $array[0] what you expect it to be? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
AutoBert Posted September 11, 2016 Posted September 11, 2016 Îs the path assigned to $file correct? If yes can you please attach the file, if no correct it and test again.
PACaleala Posted September 12, 2016 Posted September 12, 2016 What if your input file (temp.txt) has no data ?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now