<?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[Text Datei einlesen]]></title><description><![CDATA[<p>Ich hab da ein kleines Problem. Ich bin c++ Anfänger und möchte eine txt.Datei einlesen, die folgendes Muster aufweist:</p>
<pre><code>NUMOFF;MAT ;       1
NUMOFF;TYPE;       2
*ENDIF
*SET;ASMDIAG ;  6,524972293504      
*SET;_STATUS ;  1,000000000000    
DOF;DELETE
ET;       1;186
KEYOP;       1; 2;        1
NBLOCK;6;SOLID
(3i8;6e16,9)
       1       0       0 -36,6508010     -545,339752      437,072622    
       2       0       0 -36,8394628     -544,954056      437,041374    
       3       0       0 -36,4580822     -545,288083      436,546817    
       4       0       0 -36,6467441     -544,902388      436,515568    
       5       0       0 -36,4421463     -545,236913      437,082204    
       6       0       0 -36,6308081     -544,851217      437,050956    
       7       0       0 -35,9712286     -544,996273      437,209234    
       8       0       0 -36,1598905     -544,610577      437,177986    
       9       0       0 -35,8484075     -544,921434      437,391444    
      10       0       0 -36,0370694     -544,535738      437,360196    
      11       0       0 -35,7385724     -544,853862      437,562345    
      12       0       0 -35,9272343     -544,468166      437,531097      
    1889       0       0 -37,8879077     -546,394077      437,459104    
    1890       0       0 -34,3209064     -544,649362      437,458227    
N;R5,3;LOC;     -1;
EBLOCK;19;SOLID;     464
(19i8)
       1       1       1       1       0       0 
     573     521    1776     570    1297    1271    
       1       1       1       1       0       0    
     570    1776     521     573     572    1774    

CMBLOCK;C0      ;NODE;     375  ! users node component definition
(8i10)
       313       314       315       316       317       318       319 
       321       322       323       324       325       326       327        
       329       330       331       332       333       334       335        
       1720      1721      1722      1723      1724      1725      1726       
       1728      1729      1730      1731      1732      1733      1734
</code></pre>
<p>Ich würde gerne dabei die einzelnen Zahlen, die in Zeile 11-24, 28-31 und 35-39 als Variablen abspeichern, da ich damit weiterrechnen muss.<br />
Da ich Dateien leider noch nie einlesen habe und es scheinbar eine Menge Möglichkeiten gibt, wie man so etwas machen könnte, bin ich ziemlich durcheinander und weiß keinen sinnvollen Ansatz. Ich hoffe, ihr könnt mir helfen?!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/172486/text-datei-einlesen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 03:28:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/172486.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Feb 2007 15:52:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Text Datei einlesen on Mon, 05 Feb 2007 15:52:41 GMT]]></title><description><![CDATA[<p>Ich hab da ein kleines Problem. Ich bin c++ Anfänger und möchte eine txt.Datei einlesen, die folgendes Muster aufweist:</p>
<pre><code>NUMOFF;MAT ;       1
NUMOFF;TYPE;       2
*ENDIF
*SET;ASMDIAG ;  6,524972293504      
*SET;_STATUS ;  1,000000000000    
DOF;DELETE
ET;       1;186
KEYOP;       1; 2;        1
NBLOCK;6;SOLID
(3i8;6e16,9)
       1       0       0 -36,6508010     -545,339752      437,072622    
       2       0       0 -36,8394628     -544,954056      437,041374    
       3       0       0 -36,4580822     -545,288083      436,546817    
       4       0       0 -36,6467441     -544,902388      436,515568    
       5       0       0 -36,4421463     -545,236913      437,082204    
       6       0       0 -36,6308081     -544,851217      437,050956    
       7       0       0 -35,9712286     -544,996273      437,209234    
       8       0       0 -36,1598905     -544,610577      437,177986    
       9       0       0 -35,8484075     -544,921434      437,391444    
      10       0       0 -36,0370694     -544,535738      437,360196    
      11       0       0 -35,7385724     -544,853862      437,562345    
      12       0       0 -35,9272343     -544,468166      437,531097      
    1889       0       0 -37,8879077     -546,394077      437,459104    
    1890       0       0 -34,3209064     -544,649362      437,458227    
N;R5,3;LOC;     -1;
EBLOCK;19;SOLID;     464
(19i8)
       1       1       1       1       0       0 
     573     521    1776     570    1297    1271    
       1       1       1       1       0       0    
     570    1776     521     573     572    1774    

CMBLOCK;C0      ;NODE;     375  ! users node component definition
(8i10)
       313       314       315       316       317       318       319 
       321       322       323       324       325       326       327        
       329       330       331       332       333       334       335        
       1720      1721      1722      1723      1724      1725      1726       
       1728      1729      1730      1731      1732      1733      1734
</code></pre>
<p>Ich würde gerne dabei die einzelnen Zahlen, die in Zeile 11-24, 28-31 und 35-39 als Variablen abspeichern, da ich damit weiterrechnen muss.<br />
Da ich Dateien leider noch nie einlesen habe und es scheinbar eine Menge Möglichkeiten gibt, wie man so etwas machen könnte, bin ich ziemlich durcheinander und weiß keinen sinnvollen Ansatz. Ich hoffe, ihr könnt mir helfen?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1223337</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223337</guid><dc:creator><![CDATA[sestefanhome]]></dc:creator><pubDate>Mon, 05 Feb 2007 15:52:41 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Mon, 05 Feb 2007 16:11:57 GMT]]></title><description><![CDATA[<p>ich würds zeilenweise lesen, nach dem ausdruck &quot;BLOCK&quot; in jeder zeile suchen, 2 zeilen weiterspringen und dann zeile für zeile immer in strings lesen und mit</p>
<pre><code class="language-cpp">string line;
string wert;
int wAnf = find_first_of_not(&quot;\t &quot;);  // Backslash und Leerzeichen sind trennzeichen in der Datei nehm ich mal an!
int wEnd = line.size();
line = line.substr(wAnf, line.size());

while (wAnf != npos &amp;&amp; wEnd != npos) {
    wEnd = line.find_first_of(&quot;\t &quot;);
    wert = line.substr(wAnf,wEnd);
    line = line.substr(wEnd, line.size());
    wAnf = line.find_first_of_not(&quot;\t &quot;);
}

//den string wert kannste mit scanf parsen
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1223348</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1223348</guid><dc:creator><![CDATA[Ceos]]></dc:creator><pubDate>Mon, 05 Feb 2007 16:11:57 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Tue, 06 Feb 2007 17:58:54 GMT]]></title><description><![CDATA[<p>Hab jetzt mal versucht mit dem Quellcode die Zeilen 11-24 einzulesen.</p>
<pre><code>main()
{

	ifstream fin(&quot;text.txt&quot;); 

	string str;         
	string strDelimiter = &quot; &quot;; // Trennzeichen // Zerlegung von &quot;str&quot; und Ablage der Teilstrings in &quot;tokens&quot; 
	vector&lt;string&gt; tokens ;

	while (fin.eof() != true)
	{
		getline(fin, str);
		cout &lt;&lt; &quot;line:&quot;&lt;&lt; str&lt;&lt; endl;

		string::size_type nLastPos = str.find_first_not_of(strDelimiter, 0);
		string::size_type nPos     = str.find_first_of(strDelimiter, nLastPos);

		while( nPos != string::npos || nLastPos != string::npos )
		{    
			tokens.push_back(str.substr(nLastPos, nPos - nLastPos));     
			nLastPos = str.find_first_not_of(strDelimiter, nPos);    
			nPos     = str.find_first_of(strDelimiter, nLastPos);

		} 
	}
	fin.close();
	return 0;
}
</code></pre>
<p>Beim compilieren bekomme ich allerdings 4 Warnungen.</p>
<pre><code>Temporäre Dateien und Ausgabedateien für &quot;fileProbe2cdbTest1 - Win32 Debug&quot; werden gelöscht.
--------------------Konfiguration: fileProbe2cdbTest1 - Win32 Debug--------------------
Kompilierung läuft...
StdAfx.cpp
Kompilierung läuft...
fileProbe2cdbTest1.cpp
D:\Studium\Diplomarbeit\Kombinationstool\file_Probe2.cdb.txt Einlesen\fileProbe2cdbTest1\fileProbe2cdbTest1.cpp(61) : warning C4786: 'std::reverse_iterator&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const *,std::basic_strin
g&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const &amp;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const *,int&gt;' : Bezeichner wurde auf '255' Zeichen
 in den Debug-Informationen reduziert
D:\Studium\Diplomarbeit\Kombinationstool\file_Probe2.cdb.txt Einlesen\fileProbe2cdbTest1\fileProbe2cdbTest1.cpp(61) : warning C4786: 'std::reverse_iterator&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; *,std::basic_string&lt;char
,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &amp;,std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; *,int&gt;' : Bezeichner wurde auf '255' Zeichen in den Debug-Info
rmationen reduziert
c:\programme\microsoft visual studio\vc98\include\vector(47) : warning C4786: 'std::vector&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,std::allocator&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt; &gt;::
vector&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,std::allocator&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt; &gt;' : Bezeichner wurde auf '255' Zeichen in den Debug-Informationen verkürzt
c:\programme\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,std::allocator&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt; &gt;::
~vector&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;,std::allocator&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt; &gt;' : Bezeichner wurde auf '255' Zeichen in den Debug-Informationen verkürzt
Linker-Vorgang läuft...

fileProbe2cdbTest1.exe - 0 Fehler, 4 Warnung(en)
</code></pre>
<p>Ich kann damit nichts anfangen. Habt ihr da eine Idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224009</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224009</guid><dc:creator><![CDATA[sestefanhome]]></dc:creator><pubDate>Tue, 06 Feb 2007 17:58:54 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Tue, 06 Feb 2007 21:30:52 GMT]]></title><description><![CDATA[<p>Die warning C4786 kannst Du beim VC6 ignorieren. Am besten Du schaltest sie mit einem</p>
<pre><code>#pragma warning ( disable : C4786 )
</code></pre>
<p>einfach ab.</p>
<p>Der Anfang von dem Code zum Einlesen könnte so aussehen:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;fstream&gt;

struct Record
{
    friend std::istream&amp; operator&gt;&gt;( std::istream&amp; in, Record&amp; r_ )
    {
        Record r;
        if( in &gt;&gt; r.m_i[0] &gt;&gt; r.m_i[1] &gt;&gt; r.m_i[2] &gt;&gt; r.m_f[0] &gt;&gt; r.m_f[1] &gt;&gt; r.m_f[2] )
            r_ = r;
        return in;
    }
    int m_i[3];
    double m_f[3];
};

int main()
{
    using namespace std;
    ifstream fin(&quot;text.txt&quot;);
    fin.imbue( locale(&quot;german&quot;) );  // wegen ',' als Dezimaltrenner!
    for( int i=0; i&lt;10; ++i )       // ersten 10 Zeilen überlesen
        fin.ignore( 9999, '\n' );
    vector&lt; Record &gt; records;
    Record r;
    for( int j=0; j&lt;14 &amp;&amp; fin &gt;&gt; r; ++j )   // Records der Zeilen 11-24
        records.push_back( r );

    // usw.
    return 0;
}
</code></pre>
<p>Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224119</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Tue, 06 Feb 2007 21:30:52 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Wed, 07 Feb 2007 17:57:14 GMT]]></title><description><![CDATA[<p>Werner Salomon schrieb:</p>
<blockquote>
<p>Die warning C4786 kannst Du beim VC6 ignorieren. Am besten Du schaltest sie mit einem</p>
<pre><code>#pragma warning ( disable : C4786 )
</code></pre>
<p>einfach ab.</p>
</blockquote>
<p>Das hab ich probiert, geht aber nicht.</p>
<p>Ich versuche gerade mal eine txt.Datei einzulesen mit folgendem Inhalt:</p>
<pre><code>1 0 0 -36.6508010 -545.339752 437.072622
</code></pre>
<p>Mit dem Quelltext:</p>
<pre><code>ifstream datein;
datein.open(&quot;C:\\Daten.txt&quot;);

int a, b, c;
double d, e, f;

datein &gt;&gt; a &gt;&gt; b &gt;&gt; c &gt;&gt; d &gt;&gt; e &gt;&gt; f;

ofstream datauss;
datauss.open(&quot;C:\\Ausgabe.txt&quot;);

datauss &lt;&lt; a &lt;&lt; &quot; &quot; &lt;&lt; b &lt;&lt; &quot; &quot; &lt;&lt; c &lt;&lt; &quot; &quot; &lt;&lt; d &lt;&lt; &quot; &quot; &lt;&lt; e &lt;&lt; &quot; &quot; &lt;&lt; f;

datauss.close();
datein.close();
</code></pre>
<p>Die Ausgabe sieht allerdings so aus:</p>
<pre><code>1 0 0 -36.6508 -545.34 437.073
</code></pre>
<p>Er schreibt mir also nicht alle Nachkommastellen aus. Hab es schon mit atoi() und atof() probiert, geht aber auch nicht. Vielleicht mache ich aber auch was falsch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224618</guid><dc:creator><![CDATA[sestefanhome]]></dc:creator><pubDate>Wed, 07 Feb 2007 17:57:14 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Wed, 07 Feb 2007 20:07:56 GMT]]></title><description><![CDATA[<p>sestefanhome schrieb:</p>
<blockquote>
<p>Werner Salomon schrieb:</p>
<blockquote>
<p>Die warning C4786 kannst Du beim VC6 ignorieren. Am besten Du schaltest sie mit einem</p>
<pre><code>#pragma warning ( disable : C4786 )
</code></pre>
<p>einfach ab.</p>
</blockquote>
<p>Das hab ich probiert, geht aber nicht.</p>
</blockquote>
<p>sicher geht das. Ich habe gesehen, dass Du eine stdafx.h verwendest. Wenn Du das #pragma vor das erste #include in der stdafx.h einfügst; spätestens dann sollte die warning weg sein.</p>
<p>sestefanhome schrieb:</p>
<blockquote>
<p>Ich versuche gerade mal eine txt.Datei einzulesen mit folgendem Inhalt:</p>
<pre><code>1 0 0 -36.6508010 -545.339752 437.072622
</code></pre>
<p>Die Ausgabe sieht allerdings so aus:</p>
<pre><code>1 0 0 -36.6508 -545.34 437.073
</code></pre>
<p>Er schreibt mir also nicht alle Nachkommastellen aus. Hab es schon mit atoi() und atof() probiert, geht aber auch nicht. Vielleicht mache ich aber auch was falsch.</p>
</blockquote>
<p>Nein Du machst nicht falsch. Bei der Ausgabe wird die eingestellte Ausgabe-Genauigkeit von 6 Dezimalstellen hergenommen. Wenn Du mehr haben willst, so musst Du das angeben:</p>
<pre><code class="language-cpp">dataus &lt;&lt; setprecision(9); // setze Ausgabe auf 9 Dezimalstellen
  datauss &lt;&lt; a &lt;&lt; &quot; &quot; &lt;&lt; b &lt;&lt; &quot; &quot; &lt;&lt; c &lt;&lt; &quot; &quot; &lt;&lt; d &lt;&lt; &quot; &quot; &lt;&lt; e &lt;&lt; &quot; &quot; &lt;&lt; f;
</code></pre>
<p>Wichtig: das hat mit der internen Genauigkeit der double-Werte NICHTS zu tun.</p>
<p>Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224706</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Wed, 07 Feb 2007 20:07:56 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Wed, 07 Feb 2007 21:22:03 GMT]]></title><description><![CDATA[<p>Werner Salomon schrieb:</p>
<blockquote>
<p>Nein Du machst nicht falsch. Bei der Ausgabe wird die eingestellte Ausgabe-Genauigkeit von 6 Dezimalstellen hergenommen. Wenn Du mehr haben willst, so musst Du das angeben:</p>
<pre><code class="language-cpp">dataus &lt;&lt; setprecision(9); // setze Ausgabe auf 9 Dezimalstellen
  datauss &lt;&lt; a &lt;&lt; &quot; &quot; &lt;&lt; b &lt;&lt; &quot; &quot; &lt;&lt; c &lt;&lt; &quot; &quot; &lt;&lt; d &lt;&lt; &quot; &quot; &lt;&lt; e &lt;&lt; &quot; &quot; &lt;&lt; f;
</code></pre>
<p>Wichtig: das hat mit der internen Genauigkeit der double-Werte NICHTS zu tun.</p>
</blockquote>
<p>ah, danke. Darauf bin ich irgendwie nicht gekommen</p>
<p>Werner Salomon schrieb:</p>
<blockquote>
<p>sestefanhome schrieb:</p>
<blockquote>
<p>Werner Salomon schrieb:</p>
<blockquote>
<p>Die warning C4786 kannst Du beim VC6 ignorieren. Am besten Du schaltest sie mit einem</p>
<pre><code>#pragma warning ( disable : C4786 )
</code></pre>
<p>einfach ab.</p>
</blockquote>
<p>Das hab ich probiert, geht aber nicht.</p>
</blockquote>
<p>sicher geht das. Ich habe gesehen, dass Du eine stdafx.h verwendest. Wenn Du das #pragma vor das erste #include in der stdafx.h einfügst; spätestens dann sollte die warning weg sein.</p>
</blockquote>
<p>Wenn ich dich richtig verstehe, soll ich dass mal so machen:</p>
<pre><code class="language-cpp">#pragma warning ( disable : C4786 )
#include &quot;stdafx.h&quot;
#include&lt;vector&gt;
using namespace std;

int main()
{
	vector&lt;string&gt;tokens;
	return 0;
}
</code></pre>
<p>Dann bekomme ich aber immer noch 4 Warnmeldungen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224748</guid><dc:creator><![CDATA[sestefanhome]]></dc:creator><pubDate>Wed, 07 Feb 2007 21:22:03 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Wed, 07 Feb 2007 22:11:13 GMT]]></title><description><![CDATA[<p>sestefanhome schrieb:</p>
<blockquote>
<p>Wenn ich dich richtig verstehe, soll ich dass mal so machen:</p>
<pre><code class="language-cpp">#pragma warning ( disable : C4786 )
#include &quot;stdafx.h&quot;
#include&lt;vector&gt;
using namespace std;

int main()
{
	vector&lt;string&gt;tokens;
	return 0;
}
</code></pre>
<p>Dann bekomme ich aber immer noch 4 Warnmeldungen.</p>
</blockquote>
<p>Sollte zwar auch gehen; gemeint habe ich aber IN der Datei stdafx.h; also nur einmal im Projekt - egal wie viele cpp-Dateien drin sind. Und anschließend 'rebuild all' aufrufen.</p>
<p>Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224772</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Wed, 07 Feb 2007 22:11:13 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Thu, 08 Feb 2007 08:01:53 GMT]]></title><description><![CDATA[<p>Die Warning schaltet man aus indem man nur die Nummer angibt OHNE C davor</p>
<p>also so<br />
#pragma warning ( disable : 4786 )</p>
<p>und nicht so<br />
#pragma warning ( disable : C4786 )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224850</guid><dc:creator><![CDATA[schokomann]]></dc:creator><pubDate>Thu, 08 Feb 2007 08:01:53 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Thu, 08 Feb 2007 08:23:02 GMT]]></title><description><![CDATA[<p>schokomann schrieb:</p>
<blockquote>
<p>Die Warning schaltet man aus indem man nur die Nummer angibt OHNE C davor</p>
</blockquote>
<p>.. wo der Schokomann Recht hat da hat der Recht. Das kommt davon, wenn man eine Zeile Code postet, ohne es vorher auszuprobieren - sei sie auch noch so trivial.</p>
<p>Danke für den Hinweis &amp; Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224863</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Thu, 08 Feb 2007 08:23:02 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Thu, 08 Feb 2007 09:01:38 GMT]]></title><description><![CDATA[<p>ah, danke!!! Habs jetzt in der Datei stdafx.h eingefügt. Jetzt geht es auch. Vielen Dank nochmal. Selbst wäre ich da wahrscheinlich nicht darauf gekommen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224885</guid><dc:creator><![CDATA[sestefanhome]]></dc:creator><pubDate>Thu, 08 Feb 2007 09:01:38 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Thu, 08 Feb 2007 09:29:53 GMT]]></title><description><![CDATA[<p>Hi Werner,</p>
<p>kann ja mal passieren. <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>
<p>Grundsätzlich gilt:<br />
- Der Kompiler hat immer Recht.<br />
- Der Bug sitzt immer vor dem Bildschirm.</p>
<p>Gruß<br />
schokomann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1224913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1224913</guid><dc:creator><![CDATA[schokomann]]></dc:creator><pubDate>Thu, 08 Feb 2007 09:29:53 GMT</pubDate></item><item><title><![CDATA[Reply to Text Datei einlesen on Sun, 11 Feb 2007 13:01:03 GMT]]></title><description><![CDATA[<p>Ceos schrieb:</p>
<blockquote>
<p>ich würds zeilenweise lesen, nach dem ausdruck &quot;BLOCK&quot; in jeder zeile suchen, 2 zeilen weiterspringen und dann zeile für zeile immer in strings lesen und mit</p>
<pre><code class="language-cpp">string line;
string wert;
int wAnf = find_first_of_not(&quot;\t &quot;);  // Backslash und Leerzeichen sind trennzeichen in der Datei nehm ich mal an!
int wEnd = line.size();
line = line.substr(wAnf, line.size());

while (wAnf != npos &amp;&amp; wEnd != npos) {
    wEnd = line.find_first_of(&quot;\t &quot;);
    wert = line.substr(wAnf,wEnd);
    line = line.substr(wEnd, line.size());
    wAnf = line.find_first_of_not(&quot;\t &quot;);
}

//den string wert kannste mit scanf parsen
</code></pre>
</blockquote>
<p>Wie sucht man denn nach dem Ausdruck &quot;Block&quot; und springt dann zwei Zeilen weiter?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226819</guid><dc:creator><![CDATA[Nase]]></dc:creator><pubDate>Sun, 11 Feb 2007 13:01:03 GMT</pubDate></item></channel></rss>