|
-
May 23rd, 2005, 02:27 PM
#1
Thread Starter
Not NoteMe
Parsing expressions (any nice functions available?)
I'm making an MP3 file organiser.
I want to be able parse various expressions relating to either rules, or naming methods for my files.
An example of a rule might be the following:
%FileName% = %IDTagArtist% - %IDTagTitle%
A file that satisfies this rule could be the following:
My Artist - Track Title.mp3
with the IDTags for the artist and title set as "My Artist" and "Track Title" respectivly.
In C++ i'd be able to do this very easily, using IOStreams, are there any functions in the .net framework that would help me in any way with this task (such as things like inserting variables into strings when a 'n%' or whatever is encountered)?
Cheers for any replies.
Last edited by SLH; May 23rd, 2005 at 02:36 PM.
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. 
-
May 25th, 2005, 06:23 AM
#2
I wonder how many charact
Re: Parsing expressions (any nice functions available?)
such as things like inserting variables into strings when a 'n%' or whatever is encountered
well, there are a few ways to go about it - am I'm unsure how you are doing it - so here goes:
String.Replace is one option:
string fileName = string.Replace("%artistName%",artistName);
String.Format is another option:
string artistName = "Led Zepplin";
string trackName = "Over the hills";
string fileName = string.Format("{0} - {1}", artistName, trackName);
-
May 25th, 2005, 02:48 PM
#3
Thread Starter
Not NoteMe
Re: Parsing expressions (any nice functions available?)
That string.Format looks like what i want. Cheers.
Don't suppose there's anything for doing the revserse?
e.g. having a filename like:
Led Zepplin - Over The Hills.mp3
and getting the artist / title
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. 
-
May 26th, 2005, 04:35 AM
#4
Re: Parsing expressions (any nice functions available?)
I would think you would need to use Regular Expressions.
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
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
|