English
Forum

BlockRead reads CSV-File not ein; others Codierung

 

Christof
Neuß
Hi,

always if you think It's all right now again, comes of somewhere one stop sign since...

If I mean CSV-File with a Hex-editor open, sees the at the beginning so from How in the appended File To ersehen is.

These CSV-Files come of a mainframe from the Rechenzentrum and are well with a others Zeichensatz codiert. Excel, windows-editor and others programs make really no difficulty. Evtl. must I the first both characters delete, but otherwise works the.

i want these Files - The thoroughly time 150 MB big go can - in a Speicherbereich and then into/several Arrays loading, circa these then weiterverarbeiten to. The "normale", line by line lane over "Input #2, DateiInhalt$" functions, is very slow. therefore the attempt, The File with "Blockread" quick in a area To fetch.

there's no Error Message, but at first 00-byte, means to the "P" hears BlockRead on.

what can I do or which others elegant Solution there, a CSV-File ruckzuck To import?

Vielen Thanks and greetings

Christof

71 kB
Bezeichnung:Screenshot_CSV_Datei
Hochgeladen:11/04/16
Downloadcounter177
Download
 
Win10 16 GB RAM
11/04/16  
 




Michael
W.
FF FE is the BOM for UTF-16-LE.

windows Unicode is UTF-16 (LE)

WideString (v X3) can whom BOM discern and automatically Remove.

BlockRead must then with the middle-aged Syntax with Offset and amount used go. then go The data simply as Datenblock viewing and can simply be read.
with WideString and naturally too with "Declare wide stringvar" can then integrally normal from the area in variables getextet go.
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
11/04/16  
 




Christof
Neuß
means, the functions now already time to some extent well. but i'm not yet on the target...
Var File$="C:\_SEntw\_XProfanX3_1\_TestDB_mit_CSV\GGBIDA_KDU.CSV"
Var DateiLaenge&=FileSize(File$)
MessageBox(Str $(DateiLaenge&),"Meldung",0)'112436764
Var DateiGelesen&=0
Var Result$=""
Declare area#
Dim area#, DateiLaenge&
Assign #1, File$
OpenRW #1
DateiGelesen&=BlockRead(#1, area#, 0, DateiLaenge& )
Close #1
MessageBox("Fertig with Einlesen","Meldung",0)
'Result$=WideString(area#, 0)             '--> lasts forever
'Result$=WideChar(area#, 0, DateiLaenge&)  '--> Error Message Access violation!
'functions so To ca. 56.700.000
Ergebnis$=WideChar(area#, DateiLaenge&-100,100)'--> functions! STRING is means entire there.
MessageBox(left$(Result$,300),"Meldung",0)'only, to see, whether too what arrived is

The File is means over 100 MB big, The I reading would like. reading functions too. and the right quick.
The anschließende Übertrag in a normal String-Variable hakt though yet something.

Hab's first with WideString() probiert. the Program is weder in the Interpreter yet as EXE to that end come. Musste I always Cancel.

with WideChar() goes it somehow only To concise 57 Mio. characters. above it comes a Error Message.

have then time the "Ende" the Memory-Variables screen. Klappt. there are means any data in memory.

someone another idea moreover?

against "Danke and Gruß"

Christof
 
Win10 16 GB RAM
11/06/16  
 




H.Brill
The interne Listboxliste might evtl. To small his.
still loudly Help :


ex Version 11 can tappt im dunkeln up to 260.000 Strings take in
and manage


there You Version X3 to have seem, could one yet
whom attempt with
Move("FileToList", Dateiname$)

try.

in this Context would it interestingly, if The
both Move-functions (FileToList and ListToFile) too
The Codierungen as optionalen Parameter berücksichten
could. one has Yes the Öfteren differently (UTF-8, UTF-16 etc.)
codierte Text files. then could one the self-contained
conversion save.

would be one wish to that next Update.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
11/06/16  
 




Michael
W.
i know Yes not what there very then with the data occur should.
means simply time 2 Überlegungen:

1. Blockweise reading.
look you simply at times, How the Zeilenende codiert is. then a large block reading and back up to one Zeilenende. means Number of gelesenen characters reduce.
the whole Edit and again wegschreiben.
thereafter on the new (evtl. reduced) place moreover reading.
To everything through is.

2. join with Firebird or SQLite
Blockweise reading and same into data base.
And then first in the data base Edit.
there can The data almost discretionary big go.

it must Yes not everything into Hauptspeicher To this platzt.
If then The edit not satzweise erfolgen should, separate defined reaches summiert go should is a data base anyhow rather, there then through Select very plenty More and then too very plenty faster Done go can.

Übrigens I thought on a ECHTE Csv-File. These exists from several Sätzen (Zeilentrenner uncharted, there neckline To small) and inside the Sätze from several Feldern (The with TAB \t separated are).
 
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
11/07/16  
 




Christof
Neuß
Hello Michael,

many Thanks for Notes, The me that's all right weitergeholfen having. even if I now again longer Time with others Things engage was, is the Topic yet currently for me.

because of the einfachen Integration of Firebird, I will so works. target/task is it, several (relatively large) CSV files (tab separated, UTF-16) possible quick into data base To transfer.

Perhaps have You another couple Tipps for me (naturally must itself too eachone others gladly report), How I the best hinbekomme?!

Vielen Thanks and Greeting

Christof
 
XProfan X3
Win10 16 GB RAM
09/14/17  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.948 Views

Untitledvor 0 min.
Walter12/22/22
Rschnett08/06/22
ecki04/01/19
Torsten Rümker01/02/19
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie