Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 26.09.11 19:22 
Hi Delpher,

(wie) kann ich Excel dazu bringen, eine größere Feldbreite als 12 Zeichen zu verwenden, wenn ich eine Excel-Datei im DBF-Format abspeichere??
Ideal wäre es ja, wenn Excel die maximale Feldbreite iwi erkennt.

Danke für eine Idee,
Detlef

_________________
ut vires desint, tamen est laudanda voluntas
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 27.09.11 12:33 

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.

Für diesen Beitrag haben gedankt: D. Annies, storestore
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 29.09.11 06:04 
Jo, geht.
Danke, Benny!

_________________
ut vires desint, tamen est laudanda voluntas
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 29.09.11 19:17 
Autsch, jetzt habe ich ein (das) Umlauteproblem!
Wie kann man das denn lösen??
Gruß, Detlef

_________________
ut vires desint, tamen est laudanda voluntas
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 29.09.11 19:19 
Die CSV in einem Programm, was Umlaute konvertieren kann öffnen, umarbeiten und Umlaute im richtigen Zeichensatz speichern.
AWobei der den Zeichensatz für's Speichern doch anbieten sollte?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 30.09.11 20:08 
Ja, das wäre schön, aber ich sehe nur die Möglichkeit einer FindReplace-Routine, selbstgeschrieben.

Gibt's doch sicherlich schon, oder? <-- Wer hat so etwas schon codiert?

Detlef

_________________
ut vires desint, tamen est laudanda voluntas
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 01.10.11 01:24 
Also jeder gute Editor, der nicht Notepad heißt, kann dir den Zeichensatz konvertieren. Also z.B. Notepad++, PHPEdit, ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 01.10.11 12:02 
Na, ich will nicht über CSV gehen, deshalb folgender Ansatz (bisher):

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
procedure TBuchMain.Umlautekonvertieren1Click(Sender: TObject);
var i, n : integer;
begin
  TbSchueler.first; i := 0;
  repeat
    inc(i);
    for n := 0 to TbSchueler.FieldCount-1 do
    begin
      if pos(chr(132), TbSchueler.fields[n].AsString) <> 0 then
      begin
        showmessage(inttostr(i) + ' * ' + chr(228) + ' ** ' + TbSchueler.fields[n].AsString);
         //StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags)
        TbSchueler.edit;
           //TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(153), chr(214), [rfReplaceAll]);  //Ö
           //TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(148), chr(246), [rfReplaceAll]);  //ö
           TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(132), chr(228), [rfReplaceAll]);  //ä
        TbSchueler.Post;
        showmessage('Person wurde geändert');
      end;
    end;
    TbSchueler.Next;
  until TbSchueler.Eof;
  showmessage('Konvertierung ist beendet');
  lade_Tabelle(TbSchueler, buchDM_Dlg.opendialog1.filename, listbox11.items[listbox11.itemindex]);
  DBGrid1.Refresh;  //
  showmessage('Neue Tabelle ist geladen');
end;


In einem Feld sollte der Inhalt "Büro" stehen, aber ich sehe (unkonvertiert) nur "Bro".
Welches Ascii-Zeichen verbirgt sich denn dahinter?

Gruß, Detlef

_________________
ut vires desint, tamen est laudanda voluntas
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 03.10.11 13:04 
Das sieht nach einem Zeichensatz-Problem aus. Welche Delphi-Version? Mit den Tnt-Komponenten schon probiert, was sich da machen lässt?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 03.10.11 13:21 
D6E, aber ich habe alles mögliche schon hinter mir. Tnt bringt auch nichts.
Es ist (auch) ein Excel-Problem!

Na, ich suche auch weiter,
Gruß, Detlef

_________________
ut vires desint, tamen est laudanda voluntas
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 03.10.11 14:03 
Versuche mal direkt WideStrings beim Zugriff auf OLE; sonst spcukt Dir da die RTL von Delphi beim Konvertieren der Strings nach AnsiString dazwischen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 03.10.11 18:12 
So, jetzt ist Licht am Ende des Tunnels! Der Code ist wohl noch verbesserbar:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
procedure TBuchMain.Umlautekonvertieren1Click(Sender: TObject);
var i, n, k : integer;
    gauml, gouml, guuml, kauml, kouml, kuuml, szlig : boolean;
begin
  TbSchueler.first; i := 0;
  repeat
    inc(i);
    for n := 0 to TbSchueler.FieldCount-1 do
    begin
      for k := 1 to length(TbSchueler.fields[n].AsString) do
      begin
        gauml := false; gouml := false; guuml := false; kauml := false; kouml := false; kuuml := false; szlig := false;
        if (pos(chr(142), TbSchueler.fields[n].AsString[k]) <> 0then gauml := true;
        if (pos(chr(153), TbSchueler.fields[n].AsString[k]) <> 0then gouml := true;
        if (pos(chr(154), TbSchueler.fields[n].AsString[k]) <> 0then guuml := true;
        if (pos(chr(132), TbSchueler.fields[n].AsString[k]) <> 0then kauml := true;
        if (pos(chr(148), TbSchueler.fields[n].AsString[k]) <> 0then kouml := true;
        if (pos(chr(129), TbSchueler.fields[n].AsString[k]) <> 0then kuuml := true;
        if (pos(chr(225), TbSchueler.fields[n].AsString[k]) <> 0then szlig := true;

        if gauml then
        begin
          TbSchueler.edit;
            TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(142), chr(196), [rfReplaceAll]);  // Ä
          TbSchueler.Post;
        end;
        if gouml then
        begin
          TbSchueler.Edit;
            TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(153), chr(214), [rfReplaceAll]);  // Ö
          TbSchueler.Post;
        end;
        if guuml then
        begin
          TbSchueler.Edit;
            TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(154), chr(220), [rfReplaceAll]);  // Ü
          TbSchueler.post;
        end;
        if kauml then
        begin
          TbSchueler.Edit
            TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(132), chr(228), [rfReplaceAll]);  // ä
          TbSchueler.Post;
        end;
        if kouml then
        begin
          TbSchueler.Edit;
            TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(148), chr(246), [rfReplaceAll]);  // ö
          TbSchueler.Post
        end;
        if kuuml then
        begin
          TbSchueler.Edit;
            TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(129), chr(252), [rfReplaceAll]);  // ü
          TbSchueler.Post;
        end;
        if szlig then
        begin
          TbSchueler.Edit;
            TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(225), chr(223), [rfReplaceAll]);  // ß
          TbSchueler.Post;
        end;
             //TbSchueler.fields[n].AsString := stringreplace(TbSchueler.fields[n].AsString, chr(130), chr(233), [rfReplaceAll]);  // e´
      end;
      showmessage('Schüler wurde geändert');
    end;
    TbSchueler.Next;
  until TbSchueler.Eof;
  showmessage('Konvertierung ist beendet, Tabelle ' + buchDM_Dlg.opendialog1.filename + 'wird geladen');
  lade_Tabelle(TbSchueler, buchDM_Dlg.opendialog1.filename, listbox11.items[listbox11.itemindex]);
  showmessage('hi');
  qSchuelerSort(self);
  DBGrid1.Refresh;  //
  showmessage('Tabelle ist geladen');
end;


Gruß, Detlef

_________________
ut vires desint, tamen est laudanda voluntas
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 03.10.11 21:32 
Moin!

user profile iconBenBE hat folgendes geschrieben Zum zitierten Posting springen:
Das sieht nach einem Zeichensatz-Problem aus.
user profile iconD. Annies hat folgendes geschrieben Zum zitierten Posting springen:
ich habe alles mögliche schon hinter mir. [...] Es ist (auch) ein Excel-Problem!
Das hier schon mal angesehen? :les: :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 04.10.11 09:38 
Hi, Narses,

so, hab's gelesen, das Problem ist tatsächlich die Codierung von ASCII nach ANSI.
Ich gucke gerade - es gibt ja noch weitere Sonderzeichen ...

cu, Detlef

_________________
ut vires desint, tamen est laudanda voluntas