+ Reply to Thread
Results 1 to 6 of 6

Breaking up a line of text

  1. #1
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Breaking up a line of text

    I am grabbing a line of data from a txt file online everyday. When I copy and paste into an excel document it obviously dumps into one big long line in A1.

    The line looks like this:
    4/29/16 DAILY TOTALS //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 5662 4420819 781 628462833.99 142.16

    What i am looking for is something to break this up and report like this:

    A2: 4/29/16
    A3: 5662
    A4: 781
    A5: 142.16

    As you can see I do not need all of the data just a few select parts. I can not tell you that the number of "/" will always be the same.

    Thank you very very much for your help with this.

    -Ken

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Breaking up a line of text

    You'll need to use Text to columns to split this up however as / is the delimiter along with the date formatting you'd be best to use fixed width to decide how you'd like this split.

    This will however break the text in to column not rows, but you can paste transposed after this.

    You could also record a macro to use the / as delimiter then to concatenate the first 3 cells back together to create the date again, but this will all start from the use of text to columns but the DATA ribbon

  3. #3
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Breaking up a line of text

    What would be the code or formula to break the line into a separate line for each word, number? If i can break it down like that i will be able to do the rest.

    Thank you!

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Breaking up a line of text

    With the value in A1
    and A2
    the following formula

    =TRIM(MID(REPT(" ",LEN(A1))&SUBSTITUTE(A1," ",REPT(" ",LEN(A1)))&REPT(" ",LEN(A1)),A2*LEN(A1),LEN(A1)))

    will return the A2th word, ie
    if A2 is 2 the returned value is DAILY
    if A2 is 9 the returned value is 142.16
    Just adjust A2

    If you set A2 to be COLUMN() you can copy the formula across a row
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Breaking up a line of text

    Enter this formula in A2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A
    1 4/29/16 DAILY TOTALS ////////////// 5662 4420819 781 628462833.99 142.16*
    2 4/29/16
    3 5662
    4 4420819
    5 781
    6 628462833.99
    7 142.16
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Breaking up a line of text

    WOW Alkey! fancy!!!!! and i works great.

    Thank you all for the help!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 07-01-2015, 06:49 AM
  2. Replies: 1
    Last Post: 07-01-2015, 06:26 AM
  3. [SOLVED] breaking out numbers out of text
    By Pavpav in forum Excel General
    Replies: 12
    Last Post: 01-14-2013, 07:42 PM
  4. Code breaking at one line
    By concatch in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-25-2012, 08:19 AM
  5. Replies: 2
    Last Post: 10-23-2011, 06:55 PM
  6. Breaking text out
    By John Bates in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-05-2009, 07:21 PM
  7. breaking up text
    By tawnee jamison in forum Excel General
    Replies: 2
    Last Post: 01-05-2005, 07:45 PM

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