+ Reply to Thread
Results 1 to 5 of 5

Parsing data of variable lengths

  1. #1
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Parsing data of variable lengths

    Good day,

    I'm having a little trouble parsing some data the way I would like, and I think a fresh set of eyes (attached to a brain that functions better than my own) might help.

    In the attachment, I have a sample of the data I'm trying to parse. There are three columns repeated 3 times (Date, Price, and Yield). The problem I'm having is related to the variances in lengths of the strings, number of spaces between the text values, and lengths of the strings themselves.

    Any help is appreciated. If this isn't clear, or any other information would be helpful, please let me know.

    Thanks
    Attached Files Attached Files
    Last edited by JP Romano; 09-02-2011 at 04:55 PM. Reason: SOLVED

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Parsing data of variable lengths

    Do you want the 3 sets or just one set with the other two to follow?

    Can you say what the cost and yield are for row two so that we can see if the 3/8 goes with cost or yield?

  3. #3
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: Parsing data of variable lengths

    Hi, I already have the code that will compile the columns into 1 set of 3, so I'm good there.

    For row two
    Dates = 9/2 | 8/12 | 7/22
    Prices = 113-09 3/8 | 113-06 1/4 | 111-23 3/4
    Yields = .486 | .564 | .975

    The yields will generally contain a decimal, but are sometimes greater than 1 (e.g. 1.125) The prices generally,but not always, contain a fraction. Sometimes there's nothing at after the whole numbers, and sometimes there's just a "+"

    Hope that clarifies a bit, and thank you for your time!

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Parsing data of variable lengths

    hi, JP Romano, please check attachment, run code "test"
    Attached Files Attached Files

  5. #5
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: Parsing data of variable lengths

    Holy crap. Holy crap. Holy crap.
    You are unbelievable. Thank you so much... it works beautifully!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1