<?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[Dateibereiche einlesen]]></title><description><![CDATA[<p>Hallo,<br />
also ich hab eine Date mit z.B. folgendem Aufbau:<br />
<strong>2</strong>,<strong>6</strong>,<strong>0xF</strong>;<strong>4</strong>,<strong>8</strong>,<strong>0x1</strong>;</p>
<p>Jetzt möchte ich die dick gedruckten Werte alle in einer eigenen Variable abgespeichert werden (ohne , oder ; ). Nur komm ich nicht ganz dahinter wie ich es machen soll ... Hat wer ein Beispiel oder eine Anregung?`</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/328870/dateibereiche-einlesen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 07:59:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/328870.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Oct 2014 10:21:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dateibereiche einlesen on Thu, 30 Oct 2014 10:21:09 GMT]]></title><description><![CDATA[<p>Hallo,<br />
also ich hab eine Date mit z.B. folgendem Aufbau:<br />
<strong>2</strong>,<strong>6</strong>,<strong>0xF</strong>;<strong>4</strong>,<strong>8</strong>,<strong>0x1</strong>;</p>
<p>Jetzt möchte ich die dick gedruckten Werte alle in einer eigenen Variable abgespeichert werden (ohne , oder ; ). Nur komm ich nicht ganz dahinter wie ich es machen soll ... Hat wer ein Beispiel oder eine Anregung?`</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2424847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2424847</guid><dc:creator><![CDATA[Rewr]]></dc:creator><pubDate>Thu, 30 Oct 2014 10:21:09 GMT</pubDate></item><item><title><![CDATA[Reply to Dateibereiche einlesen on Thu, 30 Oct 2014 10:41:12 GMT]]></title><description><![CDATA[<p>Wie möchtest du sie speichern? Eine Datenstruktur mit drei Variablen die jeweils drei durch Kommas getrennte Werte in der Datei aufnehmen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2424854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2424854</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Thu, 30 Oct 2014 10:41:12 GMT</pubDate></item><item><title><![CDATA[Reply to Dateibereiche einlesen on Thu, 30 Oct 2014 10:46:01 GMT]]></title><description><![CDATA[<p>Rewr schrieb:</p>
<blockquote>
<p>Hat wer ein Beispiel oder eine Anregung?`LG</p>
</blockquote>
<p>Ja, such mal nach<br />
werner salomon csv</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2424855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2424855</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 30 Oct 2014 10:46:01 GMT</pubDate></item><item><title><![CDATA[Reply to Dateibereiche einlesen on Thu, 30 Oct 2014 11:01:45 GMT]]></title><description><![CDATA[<p>Rewr schrieb:</p>
<blockquote>
<p>also ich hab eine Date mit z.B. folgendem Aufbau:<br />
<strong>2</strong>,<strong>6</strong>,<strong>0xF</strong>;<strong>4</strong>,<strong>8</strong>,<strong>0x1</strong>;</p>
<p>Jetzt möchte ich die dick gedruckten Werte alle in einer eigenen Variable abgespeichert werden (ohne , oder ; ).</p>
</blockquote>
<p>Geht so oder ähnlich:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;

std::istream&amp; komma( std::istream&amp; in )
{
    char c;
    if( in &gt;&gt; c &amp;&amp; c != ',' )
        in.setstate( std::ios_base::failbit );
    return in;
}

struct Egal
{
    int i1, i2;
    std::string s3;
};

std::istream&amp; operator&gt;&gt;(std::istream&amp; in, Egal&amp; e)
{   // hier findet das eigentliche Einlesen aus der Datei statt
    return getline( in &gt;&gt; e.i1 &gt;&gt; komma &gt;&gt; e.i2 &gt;&gt; komma, e.s3, ';' );
}

int main()
{
    using namespace std;
    vector&lt; Egal &gt; eigeneVariable;
    ifstream datei(&quot;input.txt&quot;);
    if( !datei.is_open() )
    {
        cerr &lt;&lt; &quot;Fehler beim Oeffnen der Datei&quot; &lt;&lt; endl;
        return -2;
    }
    for( Egal e; datei &gt;&gt; e; )
        eigeneVariable.push_back( e );
    if( datei.eof() )
        cout &lt;&lt; &quot;Datei bis zum Ende gelesen&quot; &lt;&lt; endl;

    cout &lt;&lt; eigeneVariable.size() &lt;&lt; &quot; Eintraege gelesen&quot; &lt;&lt; endl;
    // die Daten liegen jetzt in 'eigeneVariable'

    return 0;
}
</code></pre>
<p>volkard schrieb:</p>
<blockquote>
<p>Rewr schrieb:</p>
<blockquote>
<p>Hat wer ein Beispiel oder eine Anregung?`LG</p>
</blockquote>
<p>Ja, such mal nach<br />
werner salomon csv</p>
</blockquote>
<p>Besser Google benutzen mit &quot;site:c-plusplus.net werner salomon csv&quot; - der erste Treffer ist auch gleich hilfreich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2424858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2424858</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Thu, 30 Oct 2014 11:01:45 GMT</pubDate></item></channel></rss>