Source language: Translate to:

Processing a txt file

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Processing a txt file

Postby David de Argentina » Thu May 08, 2014 10:46 am

Hi Dave,

I need process a text file that i get from a PHP file.
The MySQL server does not allow direct connection via ODBC.
Fields delimiter is the # character
Record delimiter is "<br/>" string (i can change this)

Surfing the net i found a connection string to handle txt files like:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;
Extended Properties="text;HDR=Yes;FMT=Delimited";


But i can't put in work the NeoDBPro engine.
I need show the received data into a grid.

Any ideas ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: Processing a txt file

Postby David de Argentina » Thu May 08, 2014 11:49 am

Problem solved.

I changed the field delimiter for ";" and the record delimiter to [#13][#10]

here is the code i use:

Code: Select all
DownloadFile "http://www.mysqldatabaseserver.com/folder/ops.php?id=0" "[PubDir]opers.txt" ""
dbpOpenDatabase "test2" "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[PubDir];Extended Properties=[#34]text;HDR=No;FMT=Delimited[#34];"
dbpExecSQL "test2" "select * from opers.txt" "opers"
dbpOpenTable "test2" "opers#txt" ""


Now is working on Grid and Record modes.

My 0.01
David de Argentina
User avatar
David de Argentina
 
Posts: 1559
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests