Results 1 to 9 of 9

Thread: [RESOLVED] Txt file read from, read until?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    Resolved [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#ì5Kc [tPRIV   '  WM/WMCollectionGroupID Ÿ4#ì5Kc [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:
    Code:
    TRCK
    )

    2. Read until a specified string (E.G, On the previously stated line,
    I need to read starting from what I said, up until
    Code:
    TCON
    Thanks,
    -Arightwizard
    The following statements are true. The following statement is false. The first statement is true.

  2. #2
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    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)
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


  3. #3
    Hyperactive Member BadgerBadger's Avatar
    Join Date
    Aug 2009
    Location
    Wales
    Posts
    382

    Re: Txt file read from, read until?

    Check out this thread.
    "The only thing that interferes with my learning is my education."

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    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
    The following statements are true. The following statement is false. The first statement is true.

  5. #5
    Hyperactive Member BadgerBadger's Avatar
    Join Date
    Aug 2009
    Location
    Wales
    Posts
    382

    Re: Txt file read from, read until?

    Quote Originally Posted by Arightwizard View Post
    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.
    "The only thing that interferes with my learning is my education."

  6. #6
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: Txt file read from, read until?

    Quote Originally Posted by Arightwizard View Post
    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
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


  7. #7

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    Re: Txt file read from, read until?

    Quote Originally Posted by Zeljko View Post
    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.
    The following statements are true. The following statement is false. The first statement is true.

  8. #8
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: [RESOLVED] Txt file read from, read until?

    Please, mark this thread resolved...
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


  9. #9

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    47

    Re: [RESOLVED] Txt file read from, read until?

    Quote Originally Posted by Zeljko View Post
    Please, mark this thread resolved...
    " [RESOLVED] Txt file read from, read until?"
    The following statements are true. The following statement is false. The first statement is true.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width