Results 1 to 9 of 9

Thread: The final issue!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Wink The final issue!

    Ok, my program is done. I just need to resolve one last thing. I have a lot of my files named like this:

    "Vaughn, Stevie Ray - Life By The Drop"

    I have code that splits up the Artist and song already. So I wrote code to check for a comma in the Artist string. If the comma exists, It changes the Artist string from:

    "Vaughn, Stevie Ray" TO "Stevie Ray Vaughn"

    Problem is it looks like this: "Stevie Ray___________Vaughn"

    How can I fix this? It should read: "Stevie Ray Vaughn"

    Here's my code:
    VB Code:
    1. If InStr(artist, ",") > 0 Then
    2.     temp2 = Split(artist, ",")
    3.     artist = temp2(1) & temp2(0)
    4.     End If

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    umm is it just me..or dont they both look the same??
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    VB Code:
    1. artist = Replace(artist,",","")
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Ummm..

    I don't understand that replace statement there. I have use the array values from the split

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Are the underscores supposed to be spaces?

    If so then just change this:
    VB Code:
    1. artist = temp2(1) & temp2(0)
    to:
    VB Code:
    1. artist = Trim(temp2(1)) & " " & Trim(temp2(0))
    If they are actually underscores then use this:
    VB Code:
    1. artist=Replace(artist,"_"," ")
    2. artist = Trim(temp2(1)) & " " & Trim(temp2(0))

  6. #6
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    The replace function replaces one charactor in a string, with another. I used to to replace the comma (,) in your string, with Null (thus removing it). You don't need to do a split.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    But then the name is out of order SLH. He split it because he is switching the order.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    yeah, they're spaces

    But when you post, the forum takes out spaces so I used underscores to represent them

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Thanks

    Thanks for the help. Now I can tag all of my 1685 mp3s in 5 min.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width