n9mfk9 Posted November 18, 2007 Posted November 18, 2007 Hi all here my code #include <file.au3> Dim $aRecords $ext =".mp3" If Not _FileReadToArray("names.txt",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] If $x <= 9 Then $name="en00" ElseIf $x >= 10 Then $name="en0" EndIf Msgbox(0,$name & $x,$aRecords[$x]&$ext) MsgBox(0,"", @ScriptDir&"\"& $name&$x&$ext&""& @ScriptDir&"\"&$aRecords[$x]&$ext) Next here my names.txt You've Lost That Lovin' Feelin' Unchained Melody (You're My) Soul And Inspiration Ebb Tide Just Once In My Life The White Cliffs Of Dover He Hung On You Little Latin Lupe Lu Go Ahead And Cry See That Girl On This Side Of Goodbye How can i remove spaces array I getting the name .mp3 i went name.mp3 thanks Beau
rasim Posted November 18, 2007 Posted November 18, 2007 #include <file.au3> Dim $aRecords $ext =".mp3" If Not _FileReadToArray("names.txt",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit Else For $i = 1 To $aRecords[0] $aRecords[$i] = StringStripWS($aRecords[$i], 2) Next EndIf For $x = 1 to $aRecords[0] If $x <= 9 Then $name="en00" ElseIf $x >= 10 Then $name="en0" EndIf Msgbox(0, $name & $x, $aRecords[$x] & $ext) MsgBox(0, "", @ScriptDir &"\"& $name & $x & $ext &""& @ScriptDir &"\"& $aRecords[$x]&$ext) Next
Moderators SmOke_N Posted November 18, 2007 Moderators Posted November 18, 2007 Or... #include <array.au3> $aMyArray = _ClearMySpaceBeforeMP3Array("whatever.txt") _ArrayDisplay($aMyArray) Func _ClearMySpaceBeforeMP3Array($hFile) Return StringSplit(StringStripCR(StringRegExpReplace(FileRead($hFile), "(?s)(?i)\s+.mp3", ".mp3")), @LF) EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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