[RESOLVED] Txt file read from, read until?
Hi, I'm trying to make a program that can read .mp3 data (Such as Artist, Album, Year, Track number, etc), but I need to be able to do two things that I have no clue how to do:
1. Read starting from a specified string (E.G, On one line it states:
Code:
1 3 9 1 9 2 6 ; A M G p _ i d = P 4 4 7 2 6 ; A M G t _ i d = T 1 4 3 3 1 4 5 7 TPE2 WeezerPRIV " WM/WMCollectionID Ÿ4#ì5Kc [tPRIV ' WM/WMCollectionGroupID Ÿ4#ì5Kc [tPRIV WM/Provider A M G TIT2 Pork And BeansTRCK 89375734TCON Alternative/PunkTCOM Rivers CuomoTPE1 Weezer
I need to read (for track number) Starting from:
)
2. Read until a specified string (E.G, On the previously stated line,
I need to read starting from what I said, up until
Thanks,
-Arightwizard
Re: Txt file read from, read until?
i think using Regex is the easiest way for you. Try to google it (i see it but i dont know how to write it)
Re: Txt file read from, read until?
Re: Txt file read from, read until?
Zeljko, Regex searches for patterns - not in between patterns - so I can't be helped by that.
BadgerBadger, I would prefer not to take someone's work. I only ask this small snippet from VBForums because I could not think of it myself.
Remember I asked to search in between strings, not read from mp3s with ID3 readers.
Thanks,
-Arightwizard
Re: Txt file read from, read until?
Quote:
Originally Posted by
Arightwizard
Remember I asked to search in between strings, not read from mp3s with ID3 readers.
Thanks,
-Arightwizard
In that case check out a CodeBank submission made by Vectris which shows you how to get strings in-between strings without using Regex.
Re: Txt file read from, read until?
Quote:
Originally Posted by
Arightwizard
Zeljko, Regex searches for patterns - not in between patterns - so I can't be helped by that.
...
Remember I asked to search in between strings, not read from mp3s with ID3 readers.
Right, With Regex you can find start string and end string and that givs you the middle - what you want it?
For example search for <p> start tag (paragraph) and end paragraph </p>... in the middle is you string. I see it on web when I look something similar when I need it, but then i picked up something what I can understand (i must admit that regex is preaty hevy to learn in quick maner) from this thread:
http://www.vbforums.com/showthread.php?t=579795
It helped me alot. I know it will help you also ;)
Re: Txt file read from, read until?
Quote:
Originally Posted by
Zeljko
Right, With Regex you can find
start string and
end string and that givs you
the middle -
what you want it?
For example search for <p> start tag (paragraph) and end paragraph </p>... in the middle is you string. I see it on web when I look something similar when I need it, but then i picked up something what I can understand (i must admit that regex is preaty hevy to learn in quick maner) from this thread:
http://www.vbforums.com/showthread.php?t=579795
It helped me alot. I know it will help you also ;)
Thanks, that'll do.
Re: [RESOLVED] Txt file read from, read until?
Please, mark this thread resolved... :check:
Re: [RESOLVED] Txt file read from, read until?
Quote:
Originally Posted by
Zeljko
Please, mark this thread resolved... :check:
":check: [RESOLVED] Txt file read from, read until?"