Autor Beitrag
fo3tus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 24.05.07 10:13 
hi all

ich hab bestimmte Daten aus einer Textdatei ausgelesen und sie in einer Ergebnisdatei zusammengeschrieben in tabellarischer From, sprich:
nr,kommando,ID,Startzeit,Endzeit,Laufzeit
(das auch meine Überschrift in Ergebnisdatei s.o.)
darunter ohne Leerzeilen alle ausgelesenen Daten.

Bsp.:
201--T22--D,DISPCXGRP,7082,18.05.2007 03:35:08,18.05.2007 03:35:08,00:00:00
201--T22--D,DISPCXPBX,7081,18.05.2007 03:35:07,18.05.2007 03:35:07,00:00:00
201--T41--D,STATDIU,8153,18.05.2007 05:08:32,18.05.2007 05:08:49,00:00:17

Diese Daten möchte ich nun in einer Exceltabelle speichern welche noch nicht existiert also angelegt/erstellt werden muss...
nur wie das ganze...? :?

danke im voraus
lg
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Do 24.05.07 10:28 
wenn du zwischen jeden betrag, welcher in einer einer neuen spalte stehen soll, ein TAB setzt und die datei am ende in .xls umbenennst hast du eine einfache excel tabelle. (CVS TAB-seperated).

für alles weitere (z.B. implementierte diagramme) müsstest du über ein Excel-OLE Objekt eine "echte" excel datei erstellen - macht man das noch über OLE-Objekte oder bin ich total veraltet?

Gruß
Patrick

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Do 24.05.07 10:40 
Nein du bist da nicht veraltet ;)
Also ich habs vor kurzem noch mit OLE gemacht.
Ich glaube über Explode kannst du dann deien Text pro Zeile
nach dem "," Trennen und die einzelnen "Bröckchen" in Excel einfügen.
Dafür gibt es aber gute Tutorials!

www.gidf.de

;)
Viel Glück noch!

_________________
<(^^<) <(^^)> (>^^)>
===================
fo3tus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Do 24.05.07 10:42 
hm, danke, das funktioniert schonmal...
leider weiß ich nciht wie ich die kommas durch TAB ersetzen kann...!?

lg
FiceGoesDelphi
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 485

Win XP Prof
Delphi 2006
BeitragVerfasst: Do 24.05.07 10:45 
Musst du doch garnihct oder?
Du kannst doch mit Explode auch nach "Kommas" trennen oder wo ist da das Problem?

_________________
<(^^<) <(^^)> (>^^)>
===================
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Do 24.05.07 10:46 
user profile iconpatrick hat folgendes geschrieben:
wenn du zwischen jeden betrag, welcher in einer einer neuen spalte stehen soll, ein TAB setzt und die datei am ende in .xls umbenennst hast du eine einfache excel tabelle. (CVS TAB-seperated).


Dabei kann man nicht nur Werte sondern auch Formeln angeben. :wink:

ein Tabulator kannst du mit dem passenden Code einfügen, siehe :
www.dsdt.info/grundl.../codes/asciiansi.php
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Do 24.05.07 11:26 
Hallo,

www.delphibasics.co....p?Name=StringReplace hilft Dir sicher weiter,
also
after := StringReplace(before, ',', #9,[rfReplaceAll, rfIgnoreCase]);

Uups, na klar Tab ist chr(9) oder #9

Gruß Horst
fo3tus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Fr 25.05.07 11:01 
hm, danke für eure hilfe...aber ich bekomm die kommas nicht ersetzt...anscheind reichen meine Kenntnisse noch nicht....
och menno... :(
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Fr 25.05.07 11:10 
Statt der relativ langsamen und dazu Versionsverheirateten OLE-Variante kann man auch nativ Excel-Dateien erzeugen und auch auslesen. Ich hantiere zur Zeit selbst mit dem Thema rum und bin bei Torry auf die Flexcel-Komponenten von TMS gekommen, scheinen ganz gut zu taugen.

_________________
Bravery calls my name in the sound of the wind in the night...