?
Solved

Data Import

Posted on 2009-06-30
7
Medium Priority
?
218 Views
Last Modified: 2012-05-07
I need to use vb script to pull data from a .txt file and put it in a MS Access 2003 database

i am new to this and don't even know where to begin getting the data i need from the txt file

Thanks for taking the time to help



Session Type: IPsec
 
Username     : Nymorris1              Index        : 8700
Assigned IP  : 172.16.37.19           Public IP    : .217.220.0
Protocol     : IKE IPsecOverNatT
License      : IPsec
Encryption   : 3DES                   Hashing      : MD5 SHA1
Bytes Tx     : 18163838               Bytes Rx     : 25428883
Group Policy : S&L_NY                 Tunnel Group : S&L_NY
Login Time   : 09:06:07 EDT Thu Jun 25 2009
Duration     : 5d 4h:18m:02s
NAC Result   : Unknown
VLAN Mapping : N/A                    VLAN         : none
 
Username     : nybuffalo              Index        : 15427
Assigned IP  : 172.16.36.82           Public IP    : 0.95.9.0
Protocol     : IKE IPsecOverNatT
License      : IPsec
Encryption   : 3DES                   Hashing      : MD5 SHA1
Bytes Tx     : 13089420               Bytes Rx     : 10848073
Group Policy : S&L_IN                 Tunnel Group : S&L_IN
Login Time   : 09:36:01 EDT Mon Jun 29 2009
Duration     : 1d 3h:48m:09s
NAC Result   : Unknown
VLAN Mapping : N/A                    VLAN         : none
 
Username     : nymtvernon2            Index        : 15770
Assigned IP  : 172.16.36.98           Public IP    : 0.167.178.0
Protocol     : IKE IPsecOverNatT
License      : IPsec
Encryption   : 3DES                   Hashing      : MD5 SHA1
Bytes Tx     : 5308179                Bytes Rx     : 10565827
Group Policy : S&L_NY                 Tunnel Group : S&L_NY
Login Time   : 11:52:19 EDT Mon Jun 29 2009
Duration     : 1d 1h:31m:51s
NAC Result   : Unknown
VLAN Mapping : N/A                    VLAN         : none

Open in new window

0
Comment
Question by:hoshie329
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 2

Expert Comment

by:sirtam
ID: 24747999
Hi.

You want to put this data into a table in access?
0
 

Author Comment

by:hoshie329
ID: 24748072
yes this is from a cisco ASA and I can't change the format. i do need to put this in a datatbase .
 lines 3 through 13 would cover one complete entry.

Index, Hashing, NAC, Vlan Mapping, and vlan data is not needed

Thanks
0
 
LVL 2

Expert Comment

by:sirtam
ID: 24748179
I can think of some ways to make this work, but I dont have an exact code for it so let me explain the basics:

1: Create your import specification
2: When you perform the import, you need two pieces of info: which text file to import and what table to insert into.
3: Set up the code with what text to filter out.
4: Read text from the file and put it into a String
5: Put the String into a "insert into" sql statement
6: Repeat to endOfFile

Some links which might be helpfull:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_10505639.html?sfQueryTermInfo=1+tabl+txt

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_24062188.html?eeSearch=true

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Controls/Q_22067527.html?sfQueryTermInfo=1+from+read+txt+vba

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_20449511.html?sfQueryTermInfo=1+tabl+txt
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24748380
hoshie329.

attach a sample .txt file.
check Attach File below to initiate the uploading
0
 

Author Comment

by:hoshie329
ID: 24748713
I have attached a sample of the file i will be using.
test-putty.log
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 24751063
place the sampleDb and your log file test-putty.log on the same folder

open the sampledb and click on the Import File in the form that will open. Then look at Table1
SampleDB.mdb
0
 

Author Closing Comment

by:hoshie329
ID: 31598450
Thank you very much, this works great.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question