Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 1st, 2013, 09:18 PM
Registered User
 
Join Date: Aug 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA Code to import several fix width txt files and remove headers and footers

I am trying to build a newer database 2010, based on an older one,2000, that has been locked tight and I cannot see the modules to kinda get a reference of where to start. I am trying to find a VBA code that will allow me to import a several text files to one table. The text files are all in the same format but I cannot remove the page headers and footers to get the table to look right.


Header
Header
Header
Header
Header
Header
Header
Blank Space
Name Emp# GRD DDDD DDDD WC Code Narrative Intvl Status Date Date Evt ID
Blank Space
J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
.................................................. ...2345 ABCDE ABC6 Qual Date Date 11111
.................................................. ...2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
.................................................. ...2345 ABCDE ABC6 Qual Date Date
.................................................. ...2345 ABCDE ABC6 Qual Date Date 11111
Footer
Footer

Then this repeats itself for several pages.

Also, it appears in the previous table once imported into the old AD like this:

J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date 11111
J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date 11111

If I could import the text files and end up with a table like this, it would be all i need as i could run all the queries i need from this. Any help anyone can offer I would really greaty appreciate it.

Thanks

Last edited by NEWGUY23; August 1st, 2013 at 09:52 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
import txt into table vba gerry66 Access VBA 2 February 23rd, 2011 08:34 PM
Code for sorting the elements of tree .txt files teodul C# 2005 1 June 20th, 2009 07:57 PM
How can i fix width (GridView) divekar.vishal ASP.NET 2.0 Professional 1 April 18th, 2008 09:43 AM
Import a fixed width txt file to access subhanak Access VBA 12 May 5th, 2006 05:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.