FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Import/Export from/to CSV files (; separator)
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Import/Export from/to CSV files (; separator)
Posted: Wed Nov 25, 2020 07:11 PM
Marc Venken wrote:
Silvio.Falconi wrote:
Marc Venken wrote:I use this : (found from the forum)

Maybe this be be updated of made better.

Silvio :
where is the source code complete ?


This function i have found on the forum. What would you like more ?


the problem is on function Builddbf(adata,Alengte,cDbf)

if the header is
Code (fw): Select all Collapse
Articolo;variante;Simili;Codice;Descrizione;Desc_breve;Desc_sint;tecnica;Reparto;Categoria;Marca;Codice_pro;misura;Esistenza;Disponib;Ubicazione;EAN13;Code128;Code39;Immagine;Tipocosto;Costo;Prezzo_ven;Ultprezzo;Aliquota;Note;Note_testo;Allegati;Conto_ven;Conto_acqu


n=0
for i = 1 to len(aData)
cField := aData[i]

cField is all line and it is bad because cField must be the string until the ";" symbol

then this function e not create array astru good
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Import/Export from/to CSV files (; separator)
Posted: Wed Nov 25, 2020 07:49 PM
Correct

function Builddbf(aHeader,Alengte,cDbf,cdeli)
local aStru := {}
local aFields := HB_ATokens(aHeader[1], cdeli )

for i = 1 to len(aFields)
cField = (aFields[i])
aAdd( aStru, { cField , "C", 255 , 0 } ) // I insert 255 is the max lenght
next
dbCreate( cDbf , aStru )
return nil

Now the problem is
1) how take the other lines
2) add the record on dbf created
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion