append from

append from

Postby pymsoft » Tue Mar 21, 2006 1:58 pm

¿Como debería usar el append from para importar un archivo de este tipo?

0023942433514|99
87248265|33
29401|7

con SDF sería si cada campo fuera fijo, con DELIMITED, si cada campo estuviera delimitado con "" o ' ' u otro carácter... ¿alguna idea? aparte aquella de leerlo a mano.

Gracias
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Postby pymsoft » Tue Mar 21, 2006 2:32 pm

Ya resuelto a mano...

DbCreate( zcDBF, { ;
{ "TUTTO", "C", 50, 0}, ; // tutti i campi
{ "C_BAR", "C", 13, 0}, ; // Codice a barre
{ "C_QTA", "C", 05, 0} ; // Qta
})

select 0
use (zcDBF) exclusive alias tmp_import

append from (fileName) SDF

tmp_import->( DBEVAL( {|| ( tmp_import->c_bar := SUBSTR( tmp_import->tutto, 1, AT( "|", tmp_import->tutto ) - 1 ), tmp_import->c_qta := SUBSTR( tmp_import->tutto, AT( "|", tmp_import->tutto ) + 1 ) ) } ) )
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 52 guests