How to extract certain data patterns from vb6 textbox input?


Joined
Jun 30, 2005
Messages
59
Reaction score
0
Hi all .i got the following inside a textbox inside my vb6 form. I am looking for a way to ripp the song path and title from it and use them and insert them to mysql datbase. But i do not know how to ripp those part
i be happy that an expert tell me how i can do it using vb6. The number of song path are not know in before and the parts
that i want to write to mysql are shown in bold.Thanks


data inside my texbox:
Code:
<?xml version="1.0" encoding="UTF-8" ?> 
- <player showDisplay="yes" showPlaylist="yes" autoStart="yes">
  <song path="[B]http://www.mysite.com/TtdlI3l1lIl0OOO0a/singer1/album1/song1.mp3[/B]" title="[B]song title[/B]" /> 
  <song path="[B]http://www.mysite.com/TtdlI3l1lIl0OOO0a/singer1/album1/songname2.mp3[/B]" title="[B]song title 2[/B]" /> 
  
  </player>
 
Ad

Advertisements

Joined
Jun 13, 2005
Messages
148
Reaction score
0
i dont understand what you are really doing, you might find more help being a little more specific.

However, i made a program in vb to rename id3 tags and filenames of mp3's.

this is the code i used to parse the full paths,
Code:
[size=2][color=#0000ff]
Private[/color][/size][size=2][color=#0000ff]Function[/color][/size][size=2] GetParsedNames([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] strFull [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]String[/color][/size][size=2])
 
strJustName = "" : strNameExt = ""
 
pthdestination = ""
 
strJustName = System.IO.Path.GetFileNameWithoutExtension(strFull)
 
strNameExt = System.IO.Path.GetFileName(strFull)
 
pthdestination = System.IO.Path.GetDirectoryName(strFull)
 
pthdestination = pthdestination & "\"
 
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Function[/color][/size]
[size=2][color=#0000ff]
[/color]as you can see VB has several built in parsers, i found these more reliable then looking for the last "\" and pulling till the last "." though that worked in most cases.[/size]
 
Joined
Jun 30, 2005
Messages
59
Reaction score
0
Thank u for u reply. could u tell me how to use u code t extract the bold part data .
 
Ad

Advertisements

Joined
Jun 13, 2005
Messages
148
Reaction score
0
dim dirtystring ' (full path)
dim strPath ' path without filename
dim strTitle 'filename without extension

Code:
function textbox_onchange() '(on button click, wherever)
	dirtystring=textbox1.text
	getParsednames(dirtystring)
 
 
	 strpath=pthdestination
	 strTitle=strJustName
end function

any more and your gonna have to take the time to type a real question
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top