+ Reply to Thread
Results 1 to 5 of 5

Extracting data from a CSV file

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Extracting data from a CSV file

    Hi I am trying to extract some information from a CSV file, the data fields I want are in rows and not columns. I also want some rows to be ignored. I have tried but have been unsucessful hoping someone can help.

    I am attaching the original report in a pdf and csv. What I would like to extract is:

    Record Name : John Dingle
    Date of treatment 20/01/2014
    Location Home
    Type of Treatment Counselling

    There are several different names so I would like the above to be shown for all listed.

    Many thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extracting data from a CSV file

    Hi..

    If your csv files format is the same as the sample.. this will do it..

    There is probably faster ways of doing it.. but I tested it on a CSV file with 20 000 rows.. it extracted the required info in about 1 second..

    Try the attached.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by apo; 03-18-2014 at 08:06 PM.

  3. #3
    Registered User
    Join Date
    03-18-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Extracting data from a CSV file

    Hi thanks for the reply which I tried and it works. I forgot to include the Time Allocated field as being required, which is in the csv field. I tried to see if I could add it but far too complex for me.

    Would you be able to add it?

    Many thanks in advanced, I had spent ages trying to use text to columns thinking this was the option!

  4. #4
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Extracting data from a CSV file

    Yeap sure..

    Add this line just above the "End Select" statement..

    Please Login or Register  to view this content.
    I have reattached the file with this added in case you run into problems adding the code..
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-18-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Extracting data from a CSV file

    Many thanks again for your 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. Extracting certain data from macro file
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2013, 03:38 AM
  2. [SOLVED] Extracting data from one excel file to another
    By kclalwani in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 06-07-2013, 12:43 AM
  3. Extracting data from a text file
    By lamore48 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-19-2012, 09:53 PM
  4. Extracting data from every file in a folder
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2010, 11:09 AM
  5. Extracting Data from a .txt file
    By baby_rach in forum Access Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2010, 10:09 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