+ Reply to Thread
Results 1 to 6 of 6

Problem to separate csv file data into two columns

Hybrid View

  1. #1
    Registered User
    Join Date
    09-19-2014
    Location
    Sydney
    MS-Off Ver
    excel
    Posts
    2

    Question Problem to separate csv file data into two columns

    I have a csv file that contains only two types of data - a date, then a separating coma, then a decimal number, then separating rectangular symbol, then the next date and so on. There are over a thousand days involved.

    The data reads continuously and a small cut sample is ....
    2014-09-10,0.010200
    2014-09-09,-0.077500
    2014-09-08,-0.020800
    2014-09-07,0.000000
    2014-09-06,0.000000
    2014-09-05,-0.158400
    2014-09-04,-0.149800

    I don't know why the rectangular symbols that follow each decimal number do not appear on the paste.

    I want to have the dates in a column, then the decimal numbers in an adjacent column, and then another four or more blank columns for me to calculate weekly, monthly and yearly returns as the decimal numbers represent daily return on my investment, which is going badly.

    I would appreciate any help or advice as I'm only a novice user, but willing to learn.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Problem to separate csv file data into two columns

    have you tried using the text to columns function in the data tab?

    Select your data column

    click on text to columns

    make sure delimited is selected and press next

    select comma as your delimiter and press next

    press finish
    Last edited by mehmetcik; 09-19-2014 at 08:15 PM.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Problem to separate csv file data into two columns

    Hi, welcome to the forum

    While the suggested text-to-Columns should break your data into 2 columns, and give you the dates and decimals you want, and formula alternative would be...

    =DATEVALUE(LEFT(A1,10))
    and
    =--MID(A1,12,8)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    09-19-2014
    Location
    Sydney
    MS-Off Ver
    excel
    Posts
    2

    Re: Problem to separate csv file data into two columns

    Thankyou Mehmetcik and Ford, the information and advice was just what I was looking for.
    regards,
    James

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Problem to separate csv file data into two columns

    Happy to help

  6. #6
    Registered User
    Join Date
    05-28-2012
    Location
    Pittsburgh, Pa
    MS-Off Ver
    Excel 2003 - 2007 -2010
    Posts
    49

    Re: Problem to separate csv file data into two columns

    High ground,

    Try the attached sheet with you sample data from your original post.
    It seems to work based on the two responses you were given.

    cplmckenzie
    Attached Files Attached Files

+ 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: 8
    Last Post: 01-09-2014, 10:02 AM
  2. Problem saving Excel file that copies an embedded object from a separate file
    By bhodge10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-16-2012, 02:47 PM
  3. Separate csv file by columns
    By goldcoast in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2012, 07:08 PM
  4. Replies: 0
    Last Post: 08-10-2010, 07:00 AM
  5. Problem running macro that saves into a separate file (2007 issue only)
    By mikeenc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2009, 10:45 AM

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