FrancescoDiMuro Posted December 16, 2016 Posted December 16, 2016 (edited) Hi guys! Little question... How can I write in a file a sequence of 5 strings and then, go @CRFL? The strings are generated in a For...Next loop: For $i = 0 To $iListLenght - 1 If _GUICtrlListView_GetItemChecked($listview_Lista, $i) Then $sRiga = '"' & _GUICtrlListView_GetItemText($listview_Lista, $i, 1) & '.F_CV"' & ';' & '"0,1"' EndIf Next How can I write to a file this line after 5 times a loop generated them? I thought something like put the row in an array, and then, reached the 5 times that it has been generated, write to a file... In synthesis, I need to make a group of 5 generated data, and then, go @CRLF. Can someone suggest me something, please? Thanks Edited December 16, 2016 by FrancescoDiMuro Forgot a ' Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
j0kky Posted December 16, 2016 Posted December 16, 2016 You could concatenate strings through &= operator, add the final @CRLF and then write to a file with FileWrite... Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs
FrancescoDiMuro Posted December 16, 2016 Author Posted December 16, 2016 47 minutes ago, j0kky said: You could concatenate strings through &= operator, add the final @CRLF and then write to a file with FileWrite... Hey, dear! Yeah, something like that... I need to proceed with For...Next loop in each case... Thanks Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
SadBunny Posted December 16, 2016 Posted December 16, 2016 One way that comes to mind: #include <File.au3> $aFileList = _FileListToArray("c:\windows") $outputFile = FileOpen("c:\tmp\test.txt", $FO_OVERWRITE) For $fileId = 1 To $aFileList[0] FileWrite($outputFile, $aFileList[$fileId] & ((Mod($fileId, 5) == 0 Or $fileId == $aFileList[0]) ? @CRLF : "|")) Next FileClose($outputFile) ShellExecute("c:\tmp\test.txt") Roses are FF0000, violets are 0000FF... All my base are belong to you.
FrancescoDiMuro Posted December 16, 2016 Author Posted December 16, 2016 3 minutes ago, SadBunny said: One way that comes to mind: #include <File.au3> $aFileList = _FileListToArray("c:\windows") $outputFile = FileOpen("c:\tmp\test.txt", $FO_OVERWRITE) For $fileId = 1 To $aFileList[0] FileWrite($outputFile, $aFileList[$fileId] & ((Mod($fileId, 5) == 0 Or $fileId == $aFileList[0]) ? @CRLF : "|")) Next FileClose($outputFile) ShellExecute("c:\tmp\test.txt") Hey Bunny! I managed to with a pair of If... Thanks for the reply! An interesting thing... If I managed to get paid for the work I'm doing, I could donate a percentage of the payment to this fantastic language Would be nice... Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
SadBunny Posted December 16, 2016 Posted December 16, 2016 8 minutes ago, FrancescoDiMuro said: Hey Bunny! I managed to with a pair of If... Thanks for the reply! An interesting thing... If I managed to get paid for the work I'm doing, I could donate a percentage of the payment to this fantastic language Would be nice... I'm sure that would be very welcome. Roses are FF0000, violets are 0000FF... All my base are belong to you.
FrancescoDiMuro Posted December 16, 2016 Author Posted December 16, 2016 Just now, SadBunny said: I'm sure that would be very welcome. Ahahahah, I now right Bu[dd][nn]y When I'll develop something for work, using the tools I made either with your help, If the customer pay us for the use of my tools, I'll be pretty sure I'm going to donate everytime I develop an application Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
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