|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Non-CSVtextfile dump to mysql
Hi all,
Anyone know of any shareware or scripts out there that can take a textfile of addresses which has not got the column headings in it (non-csv, just entry after entry, and not in rows), and be able to dump all data to existing table by asking what line should dump to which column? It would save me SO much time! TIA |
|
#2
|
|||
|
|||
|
RE: Non-CSVtextfile dump to mysql
If I understand your post correctly, the file looks like:
Joe User Some company 123 Main Street Apt 2A Somewhere CA 90210 or something like that? If that is the case, are there always the same number of lines for each address with blank lines in place for missing data? If so, you should be able to write such a script in a short time. |
|
#3
|
|||
|
|||
|
RE: Non-CSVtextfile dump to mysql
Hi,
Thanks for the reply - sorry for the delay in replying, been so busy. Yes, that's it exactly; every entry has the same number of lines. So...do you have any idea of what syntax I'd need for such a script? TIA |
|
#4
|
|||||
|
|||||
|
RE: Non-CSVtextfile dump to mysql
Something like what follows should work. Note that you'll have to modify it to fit your data and database. I'll also assume that the data is in the exact format posted above.
php Code:
To match with your data/table, modify the number of lines read for each entry and the order and names of fields in the table in your database inside the mysql_query statement. If you're not using MySQL, you'll also need to change the database calls, but the principle stays the same... Hope this helped. |
|
#5
|
|||
|
|||
|
RE: Non-CSVtextfile dump to mysql
Thank you for that, it is greatly appreciated
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Non-CSVtextfile dump to mysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|