Hi all,
I have a small simple program that will create an xml file from files contained in a folder mp3s actually.

It works OK but I am trying to get rid of the .mp3 extension from the title. I need it in the filename the xml is created as below

<?xml version="1.0"?>
<songs>
<song path="my_mp3s/ ANVIL_CHORUS.MP3" title="ANVIL_CHORUS.MP3">
<song path="my_mp3s/ Black Hawk Down - Leave No Man Behind.mp3" title="Black Hawk Down - Leave No Man Behind.mp3">
<song path="my_mp3s/ Im only sleeping#.mp3" title="Im only sleeping#.mp3">
<song path="my_mp3s/ nowhere man.mp3" title="nowhere man.mp3">
</songs>

but i need to remove the .mp3 from the title like this
<song path="my_mp3s/ nowhere man.mp3" title="nowhere man">

VB Code:
  1. Private Sub Command2_Click()
  2.  
  3.  
  4.     Dim f1 As Integer, jpgurl As String, xmlpath As String, MyPath As String, songpath As String, slidenode As String, SongName As String, mp3path As String, f2 As Integer, i As Integer
  5.     Dim Artist As String, artname As String, fname As String
  6.     Dim mysong As String
  7.    
  8.     mp3path = "C:\Program Files\Mgamerz\my_mp3s\"
  9.     xmlpath = "C:\Program Files\Mgamerz\"
  10.  
  11.    
  12.    
  13.      f2 = FreeFile
  14.     Open mp3path & "mp3.txt" For Output As #f2       ' if you don't need mp3.txt take out
  15.      f1 = FreeFile
  16.      
  17.     Open mp3path & "slides.xml" For Output As #f1
  18.     Print #f1, "<?xml version=""1.0""?>"
  19.     Print #f1, "<songs>"
  20.     'Print #f1, "<pic>"
  21.     SongName = Dir(mp3path & "\*.mp3")   ' get first track
  22.     i = 1
  23.     While Not Len(SongName) = 0
  24.    
  25.    
  26.     MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath))) & " " & SongName
  27.  
  28.  
  29.        
  30.               MyPath = Replace(MyPath, "\", "/")
  31.  
  32.              
  33.  
  34.            MyPath = Replace(MyPath, "", "", 1, 1)
  35.       'songpath = "<song path=""" & MyPath & """  title=""" & SongName & """/> "
  36. songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & SongName & """> "
  37.  
  38.        
  39.         Print #f1, songpath
  40.         Print #f2, SongName                  ' for mp3.txt
  41.         Sleep 100                                ' slight pause, needed
  42.         SongName = Dir                         ' get next track
  43.    
  44.     Wend
  45.    ' Print #f1, "</pic>"
  46.     Print #f1, "</songs>"
  47.  
  48.  
  49. Close
  50. End Sub

Thanks in advance