Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16

    Custom import macro

    Hi peeps. I have this software where it exports computer specs in .csv format. only issue is that what should be headers are in the column (computer name, domain etc...)

    I was hoping you guys could help me create a macro that would
    1. select the .csv i want to import from
    2. find specific words in the column
    3. import the data associated in the next column


    4. repeat for each specific bits of data

    I would do a normal import but its a case of putting column stuff into a row. any ideas? give me a clue and i can do the rest lol.

    I want this to be on a button command so an onClick() sort of thing then prompts to open file blah blah blah,,.,.,.

    Hope your all well btw

  2. #2
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Will you post a sample of the CSV file?

  3. #3
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    here tis...a sample

  4. #4
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Thanks for posting the sample. I will download and take a look.

  5. #5
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Would you mind sharing what software is generating this data?

  6. #6
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    it is a free inventory auditor

  7. #7
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Thanks.
    What is the name of the software?
    can you post a link to the site/download?

  8. #8
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    its called winaudit.exe

  9. #9
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Thanks. Is this it CLICK HERE?

    The file you posted looks to be like a standard CSV file. The first row is the column headers.

    I assume that you generate this file for a single PC at a time. All the rows will pertain to a single PC. Each row is a different item on the PC.

    I assume that you want to import the data into the same normalized fashion. Is this correct?

  10. #10
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by HiTechCoach View Post
    Thanks. Is this it CLICK HERE?

    The file you posted looks to be like a standard CSV file. The first row is the column headers.

    I assume that you generate this file for a single PC at a time. All the rows will pertain to a single PC. Each row is a different item on the PC.

    I assume that you want to import the data into the same normalized fashion. Is this correct?
    Yes that is correct. I dont however want to do it based on the headers. it has to be filtered by the content of the corresponding column. Does that make sense?

  11. #11
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    you can try to write codes to read the .csv line by line, find the column you need and then add to a table.

  12. #12
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Quote Originally Posted by sliminconcoova View Post
    Yes that is correct. I dont however want to do it based on the headers. it has to be filtered by the content of the corresponding column. Does that make sense?
    No, that does not make sense.

    The columns header tell you the structure of the file.

    Is is possible to post a sample of you database that you want to import this into. Maybe if I can see what you are doing, it will make a lot more sense.

    Otherwise, will you be more specific about what you need to do with this data?

  13. #13
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by HiTechCoach View Post
    No, that does not make sense.

    The columns header tell you the structure of the file.

    Is is possible to post a sample of you database that you want to import this into. Maybe if I can see what you are doing, it will make a lot more sense.

    Otherwise, will you be more specific about what you need to do with this data?
    Table in database will have computerid, harddrive size, processor etc for the headers. Each row within the csv are technicly acting as an identifier for this code I want to find what is in the cell to the right of "processor" is injected into the cell with Id "processor"

  14. #14
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by weekend00 View Post
    you can try to write codes to read the .csv line by line, find the column you need and then add to a table.
    thanks, thats a great help! if only i knew how to write the code...

  15. #15
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by sliminconcoova View Post
    thanks, thats a great help! if only i knew how to write the code...

    Attached is a text file that has the basic code () to import a text or csv file. You will also need the code from The Access Web at:

    http://www.mvps.org/access/api/api0001.htm


    Copy the code and paste it into a standard module. I named my module "modOpenSaveFile".

    You will have to figure out how to parse the input string, store the value in a variable, when to know you have reached the end of the data for a specific computer, how to create the SQL append statement. If you are going to update a record in a table, you will need to find the record then update the data.

    HTH
    ------
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Question on Macro to automate file import
    By delkath in forum Access
    Replies: 4
    Last Post: 05-25-2010, 04:28 AM
  2. Macro To Import CSV to ACCESS
    By csvivek in forum Import/Export Data
    Replies: 1
    Last Post: 12-07-2009, 01:49 PM
  3. import custom form data from Outlook
    By bigsteve520 in forum Import/Export Data
    Replies: 0
    Last Post: 11-13-2009, 12:18 PM
  4. import using Macro
    By johnny1g in forum Import/Export Data
    Replies: 1
    Last Post: 09-15-2009, 04:21 AM
  5. Custom Import Tool
    By naoumaro in forum Import/Export Data
    Replies: 0
    Last Post: 04-10-2009, 08:30 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