+ Reply to Thread
Results 1 to 2 of 2

Group text from a CSV file using VBA

  1. #1
    Registered User
    Join Date
    04-05-2016
    Location
    Melbourne
    MS-Off Ver
    2010
    Posts
    1

    Group text from a CSV file using VBA

    I have a .csv file with an array of text which I need to combine and sort under headings.
    Here is an example of one row of the csv file (data is just random to show what I want to do):
    Raw CSV format:

    A: Hi, my, name, is, John, B: I, am, a, builder, C: I, like, to, skateboard,

    I want to group the text based on the identifiers A:, B:, C:,
    So the data would look like this after running the macro:
    .csv format

    A: Hi my name is John, B: I am a builder, C: I like to skateboard,


    Any ideas how I could create a macro for this?

    Big ask but I am desperate!!

    Thanks

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Group text from a CSV file using VBA

    How "big" are the identifiers and do they have embedded spaces?

    The plan of approach would be to import the lines whole and remove the commas. Then look for the : and back off from there. It's the backing off part that makes me ask the questions.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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: 6
    Last Post: 09-11-2015, 08:28 PM
  2. [SOLVED] Export specific range to text file and import the text file if needed
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2015, 07:38 AM
  3. Replies: 1
    Last Post: 02-10-2014, 10:26 PM
  4. Replies: 1
    Last Post: 02-23-2013, 08:36 AM
  5. Copy Excel to Text file and pass Text file to Access Table
    By robbie_xcell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2011, 01:53 PM
  6. Importing a text file to an existing sheet, with a dialog to pick the text file
    By titushanke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2011, 01:43 PM
  7. looping, Open text file, copy text, close text file
    By jwilds1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2009, 05:12 PM

Tags for this Thread

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