+ Reply to Thread
Results 1 to 4 of 4

sub grouping convert to flat file

  1. #1
    Registered User
    Join Date
    05-10-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Cool sub grouping convert to flat file

    Hi

    I'm trying to process an Excel file that contains sub groupings/outlines in the data.

    I would like to convert this to a flat file for import and further processing into an Access database. Is it possible to do this without writing custom VBA code? I've tried exporting the data but the sub headers end up as data rows. I've also tried exporting as XML, DBF etc and re-importing into Access but that doesn't work either.

    The reason the Excel file has groupings in the first place is because the third party product we're using only exports in that format.

    Any suggestions gratefully received.

    Tushar

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: sub grouping convert to flat file

    I'm not sure whether or not it can be done without vba (I doubt it), but it would be quite easy to do with VBA. Create a sub in Access that will import the file, then run a simple DELETE SQL Query to get rid of the subtitles. It should be about 4 lines of code, something like this:

    Please Login or Register  to view this content.
    Pick a field for fieldname that is not populated only for the subgroups records.
    Last edited by davegugg; 05-13-2011 at 11:38 AM.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    05-10-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: sub grouping convert to flat file

    thanks, Dave. With the above method the child records would not have a link to the parent record, which doesn't help us. I'd have to go create VBA code to go through each line, grouping records together under the same parent, and give them a unique identifier. Only then will I be able to process the data in Access. I'm really surprised that there is no way to export the data so that the child records are automatically linked to the parent, so that we can process the data in the way we need to. I know it can be done in VBA but going through each record will be more time consuming. I'm hoping there's another way round it.

    Thanks again

    Tushar

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: sub grouping convert to flat file

    Can you post a short sample of the data?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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