parsing dir names

A

adrin

hello,
i am writing a simple c# app that will help to manage my music(mp3,ape,etc)
collection.
it is supposed to get parent directories' names from a cd and 'extract'
certain data form it.
for example lets say that dirs have the following naming scheme:
[artist][album_title][release_year,genre]
,where artist, album_title, release_year, genre is data i want to get and
process..
the question is how can i implement this ? using regular expressions or
maybe there are some string methods that can help do this :)

please help a newbie

thanks for all your previous help! ;)
 
N

Nick Malik

I hope this helps.

string[] parts = MyFilePath.Split('\');
parts[0] would get the artist
parts[1] would get the album title
parts[2] would get the release year,genre

Note: if you have the drive letter in there, you will get the drive letter
part embedded in Part[0]. Your message wasn't clear. You can pass an array
of characters to the split function to split on any character, so in that
case, you'd want to split on both '\' and ':'

Good luck
--- Nick
 
J

Justin Rogers

I would recommend using ID3 tags rather than using directory structures.
Directory structures are fairly quick
at providing information, so you can still use an artist/album title for
something like quick searches, however, you'd
probably want to use ID3 tags within the file to actually extract the remaining
information. ID3v1 and ID3v1_1 are
extremely easy to consume, each being a simple 128 byte tag stuffed on the end
of the file.
 

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

Similar Threads


Top