473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

parsing dir names

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! ;)
Nov 15 '05 #1
3 1157
Check the Path class. This might be useful enough for you.

--
Cezary Nolewajka
mailto:c.*********************@no-sp-am-eh-mail.com
remove all "no-sp-am-eh"s to reply
"adrin" <ad***@adrin.adrin> wrote in message news:Xn*****************************@193.110.122.8 0...
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! ;)

Nov 15 '05 #2
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

"adrin" <ad***@adrin.adrin> wrote in message
news:Xn*****************************@193.110.122.8 0...
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! ;)

Nov 15 '05 #3
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.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"adrin" <ad***@adrin.adrin> wrote in message
news:Xn*****************************@193.110.122.8 0...
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! ;)

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
10
by: george young | last post by:
For each run of my app, I have a known set of (<100) wafer names. Names are sometimes simply integers, sometimes a short string, and sometimes a short string followed by an integer, e.g.: 5, 6,...
5
by: LFM | last post by:
I have a table I'm importing from our SQL accounting database. The Employee Name is in one field. For the purpose of my needs, I need to extract the last name, first name and middle initial. ...
7
by: hal | last post by:
Hello, I'm a beginner to C# programming and working on some exercises. I have form where a user enters their name and when they click on a button it parses their name and puts it on 3 seperate...
9
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics"...
30
by: drhowarddrfine | last post by:
I'm working with a server that will provide me the pathname to a file, among many paths. So from getenv I may get /home/myweb/page1 but, of course, there will be many variations of that. I'm...
0
by: Divya Prakash | last post by:
Hi But I am unable to parse all the nodes of the tree .....especially the subtree of the main tree It displays only the sibling not the subtree Regards Divya
3
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
2
by: python | last post by:
I'm parsing a text file for a proprietary product that has the following 2 directives: #include <somefile> #define <name<value> Defined constants are referenced via <#name#syntax. I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.