James Bott wrote:Marc,I also have to put for the half of all fields standard data, not provided into the csv.
Stock = "1"
Language = "NL"
Currence = "EUR"
These data can be pre filled than into the master file, since I create 1 record with relevant data.
I don't work with different languages much. Could you explain in more detail? Are you saying you are going to have to translate text during the import too? Yikes!
Currency: So there is a field in each file containing which currency is used? If so then a simple DO CASE loop for each field should solve this. However, I expect you will need to use the record's date (assuming there is one) to lookup the exchange rate that was in effect at the time the data was collected in order to do the proper conversion.
Still, look for commonality rather than coding for each file-type.
James
James,
So i don't need to code much, only the loop from the master file, where the field master->source contains data like
They are always "Char" type, and that is ok for the import in the shop.
Rec 1 = "substr(csv->data,5,2)" // from the mapping routine
Rec 2 = "EUR" // set default by me
Rec 3 = "1" // set default
Rec 4 = "val(csv->price,7,2)" // mapping routine
the difficult part is to get the data right (Pre-Process expression ??) but with the dbf and not in the csv files (they are left alone)
This is the only routine with the problem for now
master->source = REC1 so it contains something like
"substr(csv->data,5,2)"
- Code: Select all Expand view
do while !master->eof()
cTemp = master->source
Cdata = cTemp // here it should execute the functions in the string, so get the data from csv->data AND process it with the function substr()
master->gooddate = cData
master->(dbskip())
enddo
Since the functions like substr() and val(), ... exist, i thought it could be done in 1 loop and FWin can process this ??
The code in the errorlog.prg looks like it. Here are also functions processed in order to get a cfield filled with data
- Code: Select all Expand view
cErrorLog += " " + Transform( ( Alias( n ) )->( RecNo() ), "99999" ) + ;
" " + Transform( ( Alias( n ) )->( RecCount() ), "99999" ) + ;
" " + cValToChar( ( Alias( n ) )->( BoF() ) ) + ;
" " + cValToChar( ( Alias( n ) )->( EoF() ) ) + CRLF + CRLF
I think it is called expression that i need to process.