DBF database questions
I have some old database (from app that worked under DOS), and now i have to convert it to some modern format (MySQL). Format of database is FoxBase+/dBase III PLUS (extension is DBF). I found some software and converted it to MySQL, BUT...
In some columns, fields look like this:
Sometime there is more $a (or any other letter), sometimes less.
If i make a query on this database, i get only:
Is there some way to "use" this $a things with PHP/MySQL or i have to remove it all (there is thousands of records in database).
In MySQL, you can put BACK TICKS (the ` character, usually on the same keyboard key as the ~ tilde character) around any string to make it a valid column name.
So, for example, you would write:
Note carefully the difference between back ticks and apostrophes. It's hard to see, so make sure you use the right characters.
SELECT * FROM sometable WHERE `$aSomeGuyName$fAdress` LIKE 'John%'
If you mean that the *CONTENT* of the field is $aSomeGuyName$fAdress, then I would say the conversion program, converting from DBF to MySQL, messed up.
Somehow, it shoved two or more field values into a single field.
If the pattern is *consistent* for all records with that particular field, then we could probably figure out how to use MySQL to clean up the data. If it is not consistent, if it only happens in some records and not in others, then you'll probably need to use PHP to decode it.
If you could give some *REAL* examples, we might be able to help.
Well here is examle (all fields are like this):
Ofc, i manage to make valid columns outh of this, but there is still problem with $aSomething. It is everywhere (pattern is consistent). Mybe you can help the fact that this base is used by some old program that worked under DOS.
insert into tablename values('22000','886.2-32','3796','$aS0mename$fOtherName$eSomethingElse','','','1699','$d2006','$a117 str.$d22 cm','$aBlahBlah','','ISBN 953-178-726-3','821.163.42-32','1','','T','0','0','D','BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah','','22.08.2006','T','F','F','','ABCDEF','','GITA4','','','T','');
Do you still have dBase 3 or equivalent? Can you look at the data and see what it *SHOULD* be?
Yes, it is like in this example, but i want to remove this $ things and insert values i get in different columns. Or to do something better with that (but as i can see, $ does not have some useful purpose).
*SIGH* I should have been more explicit.
I meant: Can you SHOW US a few records from the dBase3 database? What they looked like there? And then show us the same records as that tool changed them to MySQL?
Yes i can, but i didn't because they are the same. Here it is dbf:
and when isnerted in mysql:
I am going to *GUESS* that those are NON-ASCII characters and that the $XX stuff you are seeing if dBase's way of representing non-ASCII.
But that is not the only problem, as I can see by looking at that dump.
I *think* you need to find a copy of dBase that is localized to your language. It looks to me like the version you have there is for ASCII/English and is not working right for your language. Sorry, but I have no idea how to change those codes in MySQL, once they are imported wrongly.
Tnx for your reply. I fixed problem with ASCII characters (i replaced ascii signs with real characters), but there is still $stuff problem. I think that is some "rules" that was within DOS program that used this database. I will try to get problematic columns exploded in PHP and then inserted in new base (or something like that).