我在我們的網絡服務器上有一個.txt
文件,該文件被更新並由客戶端的第三方屬性軟件取代。如何讀取和導入.txt文件到數據庫中?
有沒有人有一個腳本(PHP/MySQL的)我可以讀取此文件並將其導入到我的數據庫中的表中?理想情況下使用codeigniter的東西,但標準的PHP也可以很好地工作。
正是在這樣的格式:
"BranchID","PropertyID","PropertyName","Street","DisplayStreet","Postcode","PricePrefix","Price","Bedrooms","Receptions","Bathrooms","ParkingSpaces","Numeric5","Numeric6","Numeric7","Numeric8","Numeric9","AREA","TYPE","FURNISHED","CHILDREN","SMOKING","PETS","GARDEN","DSS","PARKING","cFacility1","cFacility2","cFacility3","cFacility4","cFacility5","cFacility6","cFacility7","cFacility8","cFacility9","cFacility10","Tenure","ShortDescription","MainDescription","AvailabilityCode","AvailabilityDate","FullAddress","PricePrefixPos"
我的字段名稱完全匹配,這些頭。
是不是說txt一個csv其實呢? – mishu
是的,相同的格式...但文件是'xfile.txt' – Adam
這並不重要..我正在談論的格式..如果你把它重命名爲.jpg它不會使它成爲一張圖片..有很多解決方案可以將csv導入數據庫(並且您已經有答案),我只是想通過清除此問題,人們會更好地理解 – mishu