mud409 Posted July 9, 2013 Share Posted July 9, 2013 (edited) How do I write an entire array to the same line of a file? Since I've posted this I've gotten the below code to work, but this doesn't seem like the right way to do this. ;$file is a file containing multiple xml entries containing <genre> $genre = _StringBetween($file, "<genre>", "</genre>" $array = Ubound($genre) $i = 0 FileWriteLine("genres.xml", "<genres>") Do $file = FileOpen("genres.xml") $read = FileReadLine($file, 1) _FileWriteToLine("genres.xml", 1, $read & $genre[$i] & " / ",1) FileClose($file) $i = $i + 1 Until $i = $array Edited July 9, 2013 by mud409 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 9, 2013 Moderators Share Posted July 9, 2013 Try FileWrite instead of FileWriteLine. Something like this: #include <File.au3> Local $aArray[5] $aArray[0] = "Jim" $aArray[1] = "Joe" $aArray[2] = "Bob" $aArray[3] = "Nancy" $aArray[4] = "Martha" For $element in $aArray FileWrite(@DesktopDir & "\Test.txt", $element & " ") Next "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! Link to comment Share on other sites More sharing options...
mud409 Posted July 9, 2013 Author Share Posted July 9, 2013 Worked perfect. Thanks! Link to comment Share on other sites More sharing options...
jdelaney Posted July 9, 2013 Share Posted July 9, 2013 (edited) _ArrayToString could work also, but it's the same deal ...(not the writing, but the loop) Edited July 9, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
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