Import/Export from/to CSV files (; separator)

Re: Import/Export from/to CSV files (; separator)

Postby Silvio.Falconi » Wed Nov 25, 2020 7: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: Select all  Expand view
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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: Import/Export from/to CSV files (; separator)

Postby Silvio.Falconi » Wed Nov 25, 2020 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 45 guests

cron