<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Textdatei einlesen - Formatierung]]></title><description><![CDATA[<p>Hi Leutz,</p>
<p>ich möchte den Inhalt einer Textdatei einlesen und dann in meinem Programm ausgeben. Im Moment verwende ich zur Ausgabe eine ListBox. Der Text in der Textdatei ist mit Tabs getrennt. Das Problem ist die Ausgabe in der Listbox.</p>
<p>Textdatei:</p>
<pre><code>1   pfad1   file1
2   pfad2   file2
</code></pre>
<p>Listbox:</p>
<pre><code>1pfad1file1
2pfad2file2
</code></pre>
<p>Wie bekome ich die Formatierung der ListBox hin bzw. sollte ich vielleicht lieber ein anderes Objekt benutzen? Wie ist das mit tabellenartigen Objekten, also mit so mehreren Spalten oder so, würde ja auch schicker aussehen. Gibts sowas?</p>
<p>PS: Bitte Noob-konforme Antworten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
thx, MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/93212/textdatei-einlesen-formatierung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 20:34:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/93212.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Nov 2004 10:35:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Textdatei einlesen - Formatierung on Sat, 27 Nov 2004 10:35:24 GMT]]></title><description><![CDATA[<p>Hi Leutz,</p>
<p>ich möchte den Inhalt einer Textdatei einlesen und dann in meinem Programm ausgeben. Im Moment verwende ich zur Ausgabe eine ListBox. Der Text in der Textdatei ist mit Tabs getrennt. Das Problem ist die Ausgabe in der Listbox.</p>
<p>Textdatei:</p>
<pre><code>1   pfad1   file1
2   pfad2   file2
</code></pre>
<p>Listbox:</p>
<pre><code>1pfad1file1
2pfad2file2
</code></pre>
<p>Wie bekome ich die Formatierung der ListBox hin bzw. sollte ich vielleicht lieber ein anderes Objekt benutzen? Wie ist das mit tabellenartigen Objekten, also mit so mehreren Spalten oder so, würde ja auch schicker aussehen. Gibts sowas?</p>
<p>PS: Bitte Noob-konforme Antworten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
thx, MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/660375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660375</guid><dc:creator><![CDATA[dope_dope]]></dc:creator><pubDate>Sat, 27 Nov 2004 10:35:24 GMT</pubDate></item><item><title><![CDATA[Reply to Textdatei einlesen - Formatierung on Sat, 27 Nov 2004 10:52:48 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>verwende die Komponente TStringGrid. Findest du in Palette Zusätzlich.<br />
Das ist eine Tabelle, in der du mit RowCount und ColCount bestimmt, wie viele Zellen du haben willst. Dann kannst du mit Cells[Col][Row] AnsiStrings als Werte eintragen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/660385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660385</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sat, 27 Nov 2004 10:52:48 GMT</pubDate></item><item><title><![CDATA[Reply to Textdatei einlesen - Formatierung on Sat, 27 Nov 2004 11:02:00 GMT]]></title><description><![CDATA[<p>dope_dope,</p>
<p>dope_dope schrieb:</p>
<blockquote>
<p>Wie ist das mit tabellenartigen Objekten, also mit so mehreren Spalten oder so, würde ja auch schicker aussehen. Gibts sowas?</p>
</blockquote>
<p>das gibt es und nennt sich TListView.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/660397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660397</guid><dc:creator><![CDATA[dschensky]]></dc:creator><pubDate>Sat, 27 Nov 2004 11:02:00 GMT</pubDate></item><item><title><![CDATA[Reply to Textdatei einlesen - Formatierung on Sat, 27 Nov 2004 13:21:27 GMT]]></title><description><![CDATA[<p>dschensky schrieb:</p>
<blockquote>
<p>das gibt es und nennt sich TListView.</p>
</blockquote>
<p>ListView ist doch aber für sone Art Hierarchie, ich möchte einfach mehrere Spalten.</p>
<p>Ich hab jetzt den StringGrid genommen. Problem ist nur: ich hab ja drei &quot;Spalten&quot; in der Textdatei (siehe oben), die Datei wird aber zeilenweise gelesen. Die Zeilen müssen also an den tabs aufgesplittet werden, damit ich sie in die einzelnen Tabellenzellen schreiben kann.</p>
<p>Ansatz:</p>
<pre><code>// Die einzelnen Elemente aufsplitten
char input[100];
for (int z=0; z&lt;=100; z++)
{
   input[z]=zeile[z];
}
char *p;

/* strtok places a NULL terminator
in front of the token, if found */
p = strtok(input, &quot; &quot;);
if (p)   StringGrid_myDBContent-&gt;Cells[0][y]=(&quot;%s\n&quot;, p);

/* A second call to strtok using a NULL
as the first parameter returns a pointer
to the character following the token  */
p = strtok(NULL, &quot;,&quot;);
if (p)   StringGrid_myDBContent-&gt;Cells[1][y]=(&quot;%s\n&quot;, p);
</code></pre>
<p>Problem: Aber wie ist das Zeichen für Tab???????</p>
<p>Hat jemand eine Idee???<br />
thx, MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/660451</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660451</guid><dc:creator><![CDATA[dope_dope]]></dc:creator><pubDate>Sat, 27 Nov 2004 13:21:27 GMT</pubDate></item><item><title><![CDATA[Reply to Textdatei einlesen - Formatierung on Mon, 29 Nov 2004 12:20:50 GMT]]></title><description><![CDATA[<p>Die Escape Sequenz für ein Tab ist: &quot;\t&quot;</p>
<p>meinste das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/661711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/661711</guid><dc:creator><![CDATA[Beliah]]></dc:creator><pubDate>Mon, 29 Nov 2004 12:20:50 GMT</pubDate></item><item><title><![CDATA[Reply to Textdatei einlesen - Formatierung on Tue, 30 Nov 2004 14:14:59 GMT]]></title><description><![CDATA[<p>Nee meinte ich nicht, aber habs jetzt mit ° anstatt tab gemacht</p>
<p>thx, MFG<br />
dope_dope</p>
]]></description><link>https://www.c-plusplus.net/forum/post/662825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/662825</guid><dc:creator><![CDATA[dope_dope]]></dc:creator><pubDate>Tue, 30 Nov 2004 14:14:59 GMT</pubDate></item></channel></rss>