-
Nov 9th, 2021, 03:29 AM
#1
Thread Starter
New Member
Program to rename / copy mp3 files
Hey,
For my mp3 player project I need mp3 files with filenames that are a bit limited.
Maximum 32 characters, "_" instead of " " and all letters must be uppercase.
It reminds me of old days when you doenloaded songs and filenames looked like "ARTIST_-_SONG_NAME.mp3".
I would like to create a program that would rename files to that format and copy them to flash drive or even program in wich you would drag files to create a list that would then get renamed and copied.
My question is would that be possible in visual basic 6 or should I rather move to something newer like visual studio 2019 for example.
I would like to use basic 6 is because I dont have much experience in writing programs for windows, but I did made a few apps back in the day in basic 6 and I still remember some things and how to use it.
I will learn as I go, but I want to know if its even possible in basic 6 before I start.
Thank you
-
Nov 9th, 2021, 06:32 AM
#2
Re: Program to rename / copy mp3 files
Search MSDM for len() and replace() functions (and of course, copy())
Sam I am (as well as Confused at times).
-
Nov 9th, 2021, 06:47 AM
#3
Thread Starter
New Member
Re: Program to rename / copy mp3 files
Originally Posted by SamOscarBrown
Search MSDM for len() and replace() functions (and of course, copy())
Hy thank you. Will check it when I get home from work.
-
Nov 9th, 2021, 08:32 AM
#4
Lively Member
Re: Program to rename / copy mp3 files
Just for your information, there is already a free program MP3Tag that does this and much more:
https://www.mp3tag.de/en/
-
Nov 9th, 2021, 09:03 AM
#5
Re: Program to rename / copy mp3 files
Why anyone would rename to all Upper case on a Case-agnostic OS escapes me......
as to the question:
I love my linux......
http://manpages.ubuntu.com/manpages/...an1/mmv.1.html
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Nov 9th, 2021, 09:09 AM
#6
Thread Starter
New Member
Re: Program to rename / copy mp3 files
Originally Posted by LeoFar
Wow, thank you for this I tryed it out and it does the job.
I will still play a bit and see if I can make my own, but if creating the program will give me trouble I will stick to this one.
-
Nov 9th, 2021, 11:22 AM
#7
Thread Starter
New Member
Re: Program to rename / copy mp3 files
I need to modify filenames like that because otherwise mp3 module player wont read it and return error (We all love chinesse products, dont we? ).
Yep linux has a good way of doing it, but I want to create program for Windows.
-
Nov 9th, 2021, 11:24 AM
#8
Thread Starter
New Member
Re: Program to rename / copy mp3 files
I managed to get drag & drop into list working using the following code:
Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim intFile As Integer
With Data
For intFile = 1 To .Files.Count
List1.AddItem Data.Files.Item(intFile)
Next intFile
End With 'Data
End Sub
But filenames have path displayed with the filename... How can I hide the path? I`m searching for correct method, but either it doesnt work or it returns error.
-
Nov 9th, 2021, 11:41 AM
#9
Re: Program to rename / copy mp3 files
-
Nov 9th, 2021, 12:11 PM
#10
Thread Starter
New Member
Re: Program to rename / copy mp3 files
Originally Posted by jdc2000
Thats what I am trying to do, but I dont know how to get String "strFullPath" for:
GetFileNameFromPath = Right(strFullPath, Len(strFullPath) - InStrRev(strFullPath, ""))
I would need to get String(s) from List1, then use that function and returnt modified String(s) back into List1 asfar as I understand. But I dont know how.
Because asfar as I understand:
List1.AddItem Data.Files.Item(intFile)
add object and not String or Integer....
-
Nov 9th, 2021, 01:04 PM
#11
Re: Program to rename / copy mp3 files
Use split-function on full path with „\“ as delimiter.
filename is in highest member of the resultarray
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Nov 9th, 2021, 02:08 PM
#12
Thread Starter
New Member
Re: Program to rename / copy mp3 files
Originally Posted by Zvoni
Use split-function on full path with „\“ as delimiter.
filename is in highest member of the resultarray
Thank you. Will research and try.
-
Nov 9th, 2021, 02:10 PM
#13
Thread Starter
New Member
Re: Program to rename / copy mp3 files
Any idea why I cant modify or read from text boxes?
text1.Text = "sample text"
returns "Method or data member not found" and highlights .Text
Almost like somethig is missing in the program, I had reinstalled it and it is the same.
Im running it on Windows 7 x64 as admin with xp sp3 compability mode
EDIT: Openned new project and it works now.
Last edited by 0212995500229; Nov 9th, 2021 at 02:13 PM.
-
Nov 9th, 2021, 03:40 PM
#14
Thread Starter
New Member
Re: Program to rename / copy mp3 files
Update: had spent some time coding and I have text-->text2 conversion and text1-->text3-->text--2 almost finished.
Filename is being copied to text 1 and text2 renames the file.
If filename is longer than 32 characters text1 is being converted and forwarded to text3 in form2 for hand correction and then to text2.
Tommorow I must improve file gui and find a way to rename all files in folder at once. Right now I have Drivelist Dirlist and Filelist boxes, but Im not to happy with them.
-
Nov 10th, 2021, 02:08 AM
#15
Re: Program to rename / copy mp3 files
There is no "rename all files at once"
either, you collect all filenames, rename them in memory, and then loop through the result firing off the "name" function
or you run through your files and rename them in place
Aircode
Code:
Dim MyFiles() As String
Dim tmpFile() As String
'Collect FileNames and FileCount
ReDim MyFiles(1 To 2, 1 To FileCount)
For i=1 To FileCount
MyFiles(1,i)=OriginalFileName 'FullPath!!
tmpFile=Split(OriginalFileName, "\")
tmpFile(UBound(tmpFile))=UCase(Replace(tmpFile(UBound(tmpFile)), " ", "_"))
MyFiles(2,i)=Join(tmpFile,"\")
Next
For i=1 To FileCount
Name MyFiles(1,i) As MyFiles(2,i)
Next
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Nov 12th, 2021, 05:15 AM
#16
Thread Starter
New Member
Re: Program to rename / copy mp3 files
I had solved ""rename all"by using:
Code:
For X = 0 To File1.ListCount - 1
File1.Selected(X) = True
Now my question is how can I pause loop of Command1_Click() and countinue it with Form2.Command1_Click()?
The thing is that if filename is to long I open Form2 to manualy correct it (change the String).
-
Nov 12th, 2021, 05:30 AM
#17
Re: Program to rename / copy mp3 files
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Nov 12th, 2021, 05:53 AM
#18
Thread Starter
New Member
Re: Program to rename / copy mp3 files
Originally Posted by Zvoni
Open Form2 in Modal mode
That did the trick. Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|