Not enough memory to create a database
Re: Not enough memory to create a database
do you know the structure ahead of time ?
if so,
use newfile.dbf
append from mycsvfile.csv deliMITED
from the append from help file:
DELIMITED
The option DELIMITED specifies that the source file is an ASCII file with data in each line separated by commas and character fields appearing in double quotes. Fields and records can have variable lengths. ASCII files in the delimited format are managed by the database engine DELDBE.
LOOK AT ROGER'S CSV IMPORT EXAMPLE IN SAMPLES\CSV\CSVIMP.PRG
if so,
use newfile.dbf
append from mycsvfile.csv deliMITED
from the append from help file:
DELIMITED
The option DELIMITED specifies that the source file is an ASCII file with data in each line separated by commas and character fields appearing in double quotes. Fields and records can have variable lengths. ASCII files in the delimited format are managed by the database engine DELDBE.
LOOK AT ROGER'S CSV IMPORT EXAMPLE IN SAMPLES\CSV\CSVIMP.PRG
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Not enough memory to create a database
Like really no problem. It turns out. Thank you. And could you suggest how to convert this file (in DOS encoding)
- Attachments
-
- jet_raif_100.zip
- (3.51 KiB) Downloaded 764 times
Re: Not enough memory to create a database
i don't think that Xbase++ can convert Cyrillic characters ... same with chinese.Eugene Lutsenko wrote:And could you suggest how to convert this file (in DOS encoding)
when using OEM DBF Xbase++ will try to convert internal to ANSI when display with GUI XbParts.
you still need right Font / Codepage to display it

if you don't want Xbase++ to convert you must use
Code: Select all
SET CHARSET TO ansi
Code: Select all
XPP.EXE /go
greetings by OHR
Jimmy
Jimmy
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Not enough memory to create a database
Thank you very much! Well everything turned out! Didn't even think it's that simple
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Not enough memory to create a database
use newfile.dbf
append from mycsvfile.csv deliMITED
I used this method in one task very successfully. But then decided to standardize and incorporate it into the system. And when I was debugging in different examples, are faced with a problem. Sometimes it works fine and sometimes doesn't work or works incorrectly. Values are separated by delimiter and not entered in different fields and entered all or some in one field. Trying to figure out the reasons. I had the impression that this probably has something to do with different encodings of the source files. He was able to bring all this to the desired result and for a time preserved.
append from mycsvfile.csv deliMITED
I used this method in one task very successfully. But then decided to standardize and incorporate it into the system. And when I was debugging in different examples, are faced with a problem. Sometimes it works fine and sometimes doesn't work or works incorrectly. Values are separated by delimiter and not entered in different fields and entered all or some in one field. Trying to figure out the reasons. I had the impression that this probably has something to do with different encodings of the source files. He was able to bring all this to the desired result and for a time preserved.
Re: Not enough memory to create a database
Try this:
Use newfile
DC_CSV2WorkArea( 'mycsvfile.csv' )
Use newfile
DC_CSV2WorkArea( 'mycsvfile.csv' )
The eXpress train is coming - and it has more cars.
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Not enough memory to create a database
And could not bring his new text? The fact that the appeal to a CSV file using the NUMTOKEN() and TOKEN() requires a lot of memory. When a CSV file is very large (for example, 4 million records), it just crashes from memory:rdonnay wrote:Try this:
Use newfile
DC_CSV2WorkArea( 'mycsvfile.csv' )
Code: Select all
nHandle := DC_txtOpen( 'test_strings.txt' )
DO WHILE !DC_TxtEOF( nHandle ) // Начало цикла по строкам
mLine = DC_TxtLine( nHandle ) // Выделить строку из текстового файла
aStringInp := {} // Входная строка "как есть"
FOR w=1 TO NUMTOKEN(mLine,",") // Разделитель между показателями - запятая
mWord = ALLTRIM(TOKEN(mLine, ",", w))
AADD(aStringInp, mWord)
NEXT
........
DC_TxtSkip( nHandle, 1 )
ENDDO
DC_TxtClose( nHandle )
Re: Not enough memory to create a database
That is probably correct.When a CSV file is very large (for example, 4 million records), it just crashes from memory
I do not have an answer for you.
You could possibly break it into multiple files.
You would use FOpen(), FCreate(), FRead() and FWrite() to do this.
The eXpress train is coming - and it has more cars.
Re: Not enough memory to create a database
why do you AADD() all Words into Array ? this Way you need double space in RAM.Eugene Lutsenko wrote:Code: Select all
nHandle := DC_txtOpen( 'test_strings.txt' ) mWord = ALLTRIM(TOKEN(mLine, ",", w)) AADD(aStringInp, mWord)
write your Result into DBF after read 1 Line so only 1 Record Length overhead.
greetings by OHR
Jimmy
Jimmy
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Not enough memory to create a database
This is just an example, which has a TOKEN() so on...