loading from text file using column width
hi,
is it possible to place data according to the column width? this is because some of the data that i need to place are strings that have spaces in between. also, some data are not "really" separated by anything! they are placed exactly adjacent to each other... is there a way to do it in MySQL? thanks... |
You will need to do it in what ever language you are programming in - you can do it by returning the relevant substrings then remove trailing spaces.
|
please eleborate, i am new to databases... i don't get it... :confused:
|
It really doesn't have anything to do with databases - you are just manipulating a text string. To give examples we need to know the language you are using and a few example records.
|
ok, to start with, what i am doing is a web-based database running under rh 9.0, apache web server, mysql, and php.
here is a sample from the text file that i must load into the database prior to querying 03/09/00 08:01:58 Tayabas TAYABAS RTU Addr: 0x30 Acquisition Module Failed 03/09/00 08:02:00 Gateway GATEWAY RTU Addr: 0x26 Acquisition Module Ok 03/09/00 08:02:02 San Pablo 2 S3 CONCENTRATOR Addr: 0x20 Acquisition Module Ok 03/09/00 08:02:04 San Pablo 2 S3 CONCENTRATOR Addr: 0x31 Acquisition Module Ok 03/09/00 08:02:05 San Pablo 2 S3 CONCENTRATOR Addr: 0x22 Acquisition Module Ok 03/09/00 08:02:10 Gateway GATEWAY RTU Addr: 0x26 Acquisition Module Failed 03/09/00 08:02:17 Tayabas TAYABAS RTU Addr: 0x30 Acquisition Module Ok here are the fields for this text file:
|
Well I'll assume for the case of the example that the data is in a file called "data.in". Thihs example will just print the data out in a different format but you can use it to put the data into a database if you want:
Code:
<?php |
All times are GMT -5. The time now is 07:12 AM. |