Results 1 to 13 of 13
  1. #1
    William.Kalies is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7

    I have an access database I need data formatted from.

    I have an access database I need data formatted from. There


    is a column in the database with multiple strings concatenated together, I
    need them split up and then appended to a new row with the values from the
    row.


    For example, the row may read Zztest,Joshua 01/01/1970
    00001000020000300004. I need the 00001 broke out into a unique row with the
    preceding values, the value in that column will always have the same number
    of characters. That row need to be exported as:
    Zztest,Joshua 01/01/1970 00001
    Zztest,Joshua 01/01/1970 00002
    Zztest,Joshua 01/01/1970 00003
    Zztest,Joshua 01/01/1970 00004

    Any help would be greatly appreciated.

    Thanks,
    Will

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    use EXTERNAL DATA, IMPORT TEXT, FIXED WIDTH

    use cursor to mark the break boints of the various fields.

  3. #3
    William.Kalies is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    I think that would work except for the last field which has the groups of numbers (groups of four). Sometimes the last field will just contain the four numbers, other times eight or twelve numbers that need to be broken into groups of four. I will definitely give your suggestion a shot. Thanks.

  4. #4
    William.Kalies is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    That didn't work Mainly because I need the information copied from the first couple fields and then inserted into new records breaking up the last field which is broken into groups of four.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Its not clear where the data is coming from: an external file or a table in the current dB. Do you want the the parsed data (Zztest,Joshua 01/01/1970 00001) to go into the same table or a different table or written to a a text file or .....???

    In any case, it sounds like you probably have to use VBA to get the results you require/desire.
    In vastly general terms, it is:
    1) Read a line/record
    2) Parse the data
    3) Write a line/record.

    Is this a one time job?

  6. #6
    William.Kalies is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    Sorry, I am just starting to use forums so sometimes my questions may seem very vague. The data is coming from 60 tables (all formatted the same) within an access database. The information should go into a new table in the same database. This is a one-time job of migrating old data into a new table and splitting up the last field into groups of four (the last field contains a collection of numbers such as 000100020003000400050008, however the amount of number is different for every record). Thank you in advance for any assistance.

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    How are your skills programming with VBA?

  8. #8
    William.Kalies is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    Intermediate, basically if I have a starting point and some pointers along the way I should be able to get this working. I worked for the Dept. of Corrections building and coding Access databases for almost ten years before starting at my current job. Just a little rusty on the coding aspect.

  9. #9
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would create a new table the would hold the names of the 60 tables with the data you want to parse.

    Does the data look like
    Zztest,Joshua 01/01/1970
    00001000020000300004

    or like
    Zztest,Joshua 01/01/197000001000020000300004 ??


    Is the data in 1 field or 2?

  10. #10
    William.Kalies is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    It is in three fields, the name, the DOB, and then the collection of numbers I need to split up. I think I have a rough sketch of what needs to happen, and I'll be creating a new table. After having the process stew around in my head some I think I've got it. Thanks for the pointers.

  11. #11
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I don't know your field names or the structure of the tables, but I threw together an example.
    "Table1" and "Table2" are data source tables
    "tblTables" is the table that has the source tables with data to parse
    "Results" is the new table of parsed data.....

    Since you are already parsing the data, I would change the structure of the new table to have "LastName" and "FirstName" fields (be aware "Name" is a reserved word in Access and shouldn't be used for object names).
    It is easier to split the names now rather than try and split them later.



    Hope it helps...



    Oops, just saw you last post......
    Last edited by ssanfu; 10-16-2014 at 01:23 PM. Reason: added comment/ changed attachment

  12. #12
    William.Kalies is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    7
    Thank you very much. I was in the middle of writing some of that code so it saved me some work. I appreciate your help on this.

  13. #13
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Glad to help....

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-24-2013, 11:47 PM
  2. Export formatted access report into excel
    By 555Rage in forum Import/Export Data
    Replies: 5
    Last Post: 10-10-2012, 11:18 AM
  3. Best way to import badly formatted data
    By mkallover in forum Import/Export Data
    Replies: 3
    Last Post: 09-16-2010, 01:59 PM
  4. EDI data into Access database
    By cazper67 in forum Access
    Replies: 2
    Last Post: 07-24-2010, 05:57 PM
  5. Displaying data formatted
    By Zoroxeus in forum Forms
    Replies: 0
    Last Post: 03-14-2006, 09:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums