Hello, i'm a german and my english is very bad. the index-file is corrupt. source-code:
// $this_pos is a offset in import-file
if($this_pos==0){ // Index anlegen
$struct = array(array("id", "str"), array("record", "str"));
$idb = new TextDB;
$idb->create($idx_kar_pkz, $struct, true);
}
else { // Index ffnen
$idb = new TextDB;
$idb->open($idx_kar_pkz);
}
// write data
for ($i=$this_pos;$i<$this_size;$i++) // DBF-Datei abarbeiten
{
$dbf->get_record($i); // Datensatz laden
$Kar["PKZ"] = $eb->pkz($dbf->get_field("PKZ"));
// Index ergnzen
$recnum = $idb->find("id", $Kar["PKZ"]);
$indexdata = $idb->get($recnum);
if($indexdata==TRUE) {
$indexdata["id"]=$Kar["PKZ"];
$indexdata["record"]=$indexdata["record"]."|$i";
$idb->edit($indexdata);
}
else {
$indexdata["id"]=$Kar["PKZ"];
$indexdata["record"]=$i;
$idb->add($indexdata);
}
//$Kar["PKZ"] is a string - sample "00001322" or "45123002", $i is a recordnumber in import-file.
$idb->compact();
$idb->close();
-------------------------------------------
When I looking in the data-file I find this records - sample:
at pos 2345: 28035003 19530
at pos 25134: 28035003 21859|21861|21862|21863|21864|21865|21866|21867|21868|21869|21870|21871|21872|21873|21874|21875
at pos 30256: 28035003 21860|76162
Is function compact buggy ?
When you will, then I mail the complete source code and data ?!
Thanks
Samson
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
have you tried it without the compact function in there? if so, and it still doesn't work, i'd suggest sending me your code and data, and seeing if i can figure it out too.
andy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, i'm a german and my english is very bad. the index-file is corrupt. source-code:
// $this_pos is a offset in import-file
if($this_pos==0){ // Index anlegen
$struct = array(array("id", "str"), array("record", "str"));
$idb = new TextDB;
$idb->create($idx_kar_pkz, $struct, true);
}
else { // Index ffnen
$idb = new TextDB;
$idb->open($idx_kar_pkz);
}
// write data
for ($i=$this_pos;$i<$this_size;$i++) // DBF-Datei abarbeiten
{
$dbf->get_record($i); // Datensatz laden
$Kar["PKZ"] = $eb->pkz($dbf->get_field("PKZ"));
// Index ergnzen
$recnum = $idb->find("id", $Kar["PKZ"]);
$indexdata = $idb->get($recnum);
if($indexdata==TRUE) {
$indexdata["id"]=$Kar["PKZ"];
$indexdata["record"]=$indexdata["record"]."|$i";
$idb->edit($indexdata);
}
else {
$indexdata["id"]=$Kar["PKZ"];
$indexdata["record"]=$i;
$idb->add($indexdata);
}
//$Kar["PKZ"] is a string - sample "00001322" or "45123002", $i is a recordnumber in import-file.
$idb->compact();
$idb->close();
-------------------------------------------
When I looking in the data-file I find this records - sample:
at pos 2345: 28035003 19530
at pos 25134: 28035003 21859|21861|21862|21863|21864|21865|21866|21867|21868|21869|21870|21871|21872|21873|21874|21875
at pos 30256: 28035003 21860|76162
Is function compact buggy ?
When you will, then I mail the complete source code and data ?!
Thanks
Samson
have you tried it without the compact function in there? if so, and it still doesn't work, i'd suggest sending me your code and data, and seeing if i can figure it out too.
andy