MP3 Change Filename

kindi1000

New Member
Joined
May 2, 2005
Messages
26
I have a macro which changes the names of songs, but it cannot change the names of particular songs because it cannot find them. The reason being - the filename uses a symbol which is not recognized by vb. Is there a way to only search the first 40 characters of a song title and save it by that new name (i.e.: leave only the first 40 characters of the name as the name)? An example of a title is:

003 - Rihanna ft. Jay-Z - Umbrella [Torrent-Tatty] (� IDJMG).MP3

The questionmark symbol shows up as an unidentifiable symbol. There are a lot of spaces in the file name. Thanks.
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
That's an interesting one, vb should be able to read/write the full unicode set even if excel doesn't display it right. Care to post the macro, might be to just debug it a little.
 

kindi1000

New Member
Joined
May 2, 2005
Messages
26
Thanks. The macro is as follows:

Sub CopyMP3()
Dim oFileName As Variant
Dim nFileName As Variant
Dim i As Variant

Range("B11").Select
i = 1
Do While ActiveCell.Offset(i, -1).Value <> ""
If ActiveCell.Offset(i, -1).Value <> "" Then
oFileName = ActiveCell.Offset(i, -1).Value
nFileName = ActiveCell.Offset(i, 0).Value
FileCopy oFileName, nFileName
End If

i = i + 1
Loop
End Sub


I basically rename a file based on a new filename, but VB could need read the "?" symbol in the original filename. Thanks.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,628
Office Version
365
Platform
Windows
Eh, that's not renaming a file - it's copying a file.:eek:

It's probably difficult to pinpoint a particular file without the exact name.

Is there any naming convention for either the old filename or the new filename?

Are all the files in the same directory?
 

WaxonWaxov

Board Regular
Joined
Apr 9, 2009
Messages
141
you may need to look at each character in the string and look at it's ASCII value and change certain one into blanks or underscores or something like that.
 

kindi1000

New Member
Joined
May 2, 2005
Messages
26
True - but the way I rename is to copy in case I mess something up. There is naming convention, but that is done within Excel - but I think we could probably ignore that for now. All the files are in the same directory. If you think that renaming rather than copying would make my life easier, then I'm all for that. Thanks.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,628
Office Version
365
Platform
Windows
Why ignore the naming convention if it might help?:unsure:
 

kindi1000

New Member
Joined
May 2, 2005
Messages
26
Ok. The naming convention I use is:

Lets take the following filename:
003 - Rihanna ft. Jay-Z - Umbrella [Torrent-Tatty] (� IDJMG).MP3

I would change it to:
Rihanna ft. Jay-Z - Umbrella.MP3

Thanks.
 

Watch MrExcel Video

Forum statistics

Threads
1,101,866
Messages
5,483,396
Members
407,395
Latest member
Sakshine

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top