473,809 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

populating tables from text files

Hi there,

I'm not sure if SQL is capable of this so I would like your ideas and
comments.

I have over a thousand text files with in the below format.

[Win32_Operating System]
ComputerName=co mputerHostName
OSName=Microsof t Windows XP Professional
OSVersion=5.1.2 600
ServicePackMajo rVersion=1
ServicePackMino rVersion=0
OSSerialNumber= bla bla bla
InstallDate=08/09/2004 15:53
LastBootUpTime= 04/11/2004 09:10

[Win32_ComputerS ystem]
Domain=mine.com
Manufacturer=He wlett-Packard
Model=HP Compaq nc6000
TotalPhysicalMe mory=1,023 MB

[Win32_Processor]
Count=1
CurrentClockSpe ed=797

[Win32_BIOS]
SMBIOSVersion=6 8BDD Ver. F.0A
SerialNumber=Bl a Bla Bla

[Win32_LogicalDi sk (size in MB)]
Count=2
Size of C: drive=29,996
FreeSpace on C: drive=19,885
%FreeSpace on C: drive=66%
Size of D: drive=8,151

What i want to do is take each field from these text files and put them into
a MySQL table. Ignoring the lines with the headings in i.e [ignore]

Is there an sql statement i could use to readline from a text file and put
it into MySQL or is this something i would need to write a VB script for?

Also the second problem comes once it has finished one text file i want it
to move onto the next text file in the folder. As i say this folder
contains over 2 thousand text files and I will want to run this script at
least once a week to update the tables.

Any ideas would be greatly appreciated.

Thanks in advance
--

Jamie Allison
Sheffield Hallam University
Software Engineering
Final Year
Jul 23 '05 #1
2 2193
Jamie wrote:
What i want to do is take each field from these text files and put them into
a MySQL table. Ignoring the lines with the headings in i.e [ignore]

Is there an sql statement i could use to readline from a text file and put
it into MySQL or is this something i would need to write a VB script for?


I would do this in some application code, and VB should be just fine for
that (other languages would be fine too). I can't think of a
straightforward way to do this purely in SQL.

Also, these problems have a tendency to expand: next you'll be parsing
other types of files, or the files will have new kinds of syntax within
them. Writing a script or a series of scripts is a better way to
accommodate changing requirements, since a SQL solution would be more
complex and more difficult to alter.

Regards,
Bill K.
Jul 23 '05 #2
>Jamie wrote:
What i want to do is take each field from these text files and put them into
a MySQL table. Ignoring the lines with the headings in i.e [ignore]

Is there an sql statement i could use to readline from a text file and put
it into MySQL or is this something i would need to write a VB script for?


If you're looking at a one-time import, and don't mind a kludge, you can use an
app (maybe Excel / OpenOffice) ? to export the HTML table to CSV, and then
import that file into MySQL. It's certainly not a programmatic solution, nor
one to be proud of, but it'll get the job done fairly quickly. <g>

Other ideas are available via Google :
http://www.google.com/search?num=25&...SV&btnG=Search
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
966
by: amber | last post by:
I've been trying to figure out how to get 2 datasets to populate a report/subreport - and I think I'm on the right track...just having a few problems somewhere... I have created a dataset (.xsd) consisting of 2 tables - one is coming from a table in SQL, the other from a view. The 1st table is populating correctly , but the 2nd isn't. I'm assuming I can't populate my dataset twice and have it work properly. Am I even on the right...
3
24039
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked tables in the database where the code resides. If we move the database with the data tables to a new directory, the links are no longer valid. I tried to update the links by changing the Connect property and refreshing: Set td = db.TableDefs(0)...
1
1579
by: Jeremy | last post by:
Hi, I hope (expect!) this is straightforward - at this stage I need to know the feasibility of this. The scenario: a webserver running a database. A subset of the data (say 3 tables) needs to be loaded into an access database on a private serve someplace else (private LAN). My initial thoughts are: - generate from webserver database .csv formatted files (incrementals) - automatically ftp these to remote machine
2
2460
by: GUEST | last post by:
can anyone tell me if its possible to create tables and populate tables using a script via notepad ? cheers -- reply to newsgroupsurferATyahooDOTcom
6
2885
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
3
6047
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is "LabLocation_ID". With an existing lab, they then need to add the members for that lab. So, what I am trying to do is the following. With the FormView of the Lab open, the user will click a button to open a FormView (InsertMode) and add a new...
0
1732
by: teju | last post by:
Hi all, I am trying to populate tree view from the database. Till two levels i can populate it fine but when it reaches third level it doesn't expand. Below is the code, it has been taken from the reference of micrososft Sub PopulateNode(ByVal sender As Object, ByVal e As TreeNodeEventArgs) ' Call the appropriate method to populate a node at a particular level. If e.Node.ChildNodes.Count = 0 Then Select Case...
2
3273
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once selecting from the combo box, I have all the combo boxes, using afterupdate, populating their respective list boxes. These text boxes are directly correlated to the combo box selection using SQL. Here is an example from the afterupdate event in the...
0
1339
by: Bomac8 | last post by:
I have a text file with "|" as a delimeter with three (3) fields XXX-12345|\\YYYYYYY|\\ZZZZZZZZ I need to read these files into an output folder. The problem that I'm having is that I need to create folders with the first part of the files (xxx-12345) and place the files \\YYYYYYY AND \\ZZZZZZZZ in this folder. Here is the code that I have so far.. Imports System.IO Public Class frmRedaction_Copier Inherits...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7660
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.