<?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[suchen von da bis da]]></title><description><![CDATA[<p>hallo,</p>
<p>aus einem berechnungsprogramm lasse ich mir eine txt-datei herausschreiben das so aussieht:<br />
text<br />
text<br />
text<br />
textmarke1<br />
zahlen<br />
zahlen<br />
textmarke2</p>
<p>jetzt würde ich gerne ein programm schreiben, dass diese txt-datei öffnet, die textmarke1 sucht und eine zeile darunter (die zahlen) bis zur textmarke2 (diese nicht) verarbeitet. also den block zwischen textmarke1-textmarke2 verarbeitet. wie kann ich so eine suchfunktion von einem block in einer textdatei erstellen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/246581/suchen-von-da-bis-da</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 01:42:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/246581.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Jul 2009 07:55:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to suchen von da bis da on Thu, 30 Jul 2009 07:55:28 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>aus einem berechnungsprogramm lasse ich mir eine txt-datei herausschreiben das so aussieht:<br />
text<br />
text<br />
text<br />
textmarke1<br />
zahlen<br />
zahlen<br />
textmarke2</p>
<p>jetzt würde ich gerne ein programm schreiben, dass diese txt-datei öffnet, die textmarke1 sucht und eine zeile darunter (die zahlen) bis zur textmarke2 (diese nicht) verarbeitet. also den block zwischen textmarke1-textmarke2 verarbeitet. wie kann ich so eine suchfunktion von einem block in einer textdatei erstellen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752072</guid><dc:creator><![CDATA[rasidrasid]]></dc:creator><pubDate>Thu, 30 Jul 2009 07:55:28 GMT</pubDate></item><item><title><![CDATA[Reply to suchen von da bis da on Thu, 30 Jul 2009 08:17:42 GMT]]></title><description><![CDATA[<p>was hast du denn bisher schon? irgendwelche Ideen? Oder gar schon einen Ansatz im Code? Lies dir bitte den Thread &quot;Du brauchst Hilfe?&quot; hier im Forum durch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752080</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752080</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 30 Jul 2009 08:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to suchen von da bis da on Thu, 30 Jul 2009 08:19:54 GMT]]></title><description><![CDATA[<p>Du <a href="http://www.cppreference.com/wiki/io/start" rel="nofollow">lädst</a> den <a href="http://www.cppreference.com/wiki/string/start" rel="nofollow">Text</a> und <a href="http://www.cppreference.com/wiki/string/find" rel="nofollow">suchst</a> darin nach deinen Textmarken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752081</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752081</guid><dc:creator><![CDATA[Registrierter Troll]]></dc:creator><pubDate>Thu, 30 Jul 2009 08:19:54 GMT</pubDate></item><item><title><![CDATA[Reply to suchen von da bis da on Thu, 30 Jul 2009 08:23:30 GMT]]></title><description><![CDATA[<p>Naja fang einfach mal an.</p>
<p>Schreibe ein Programm das dein File öffnet und komplett ausliest (was du sowieso Zeile für Zeile machen musst)</p>
<p>Und wenn du das hast baust du dir ein if dazu:</p>
<pre><code class="language-cpp">// Alles pseudocode!!!
while ((readline = File.readline ()) != null)
{
  if (readline == textmarke1)
  {
    // ab dem nächsten readline kommen die Zahlen
  }
  if (readline == textmarke2)
  {
    break;
  }
}
</code></pre>
<p>Könnte man besser und schöner machen, aber das dürfte so ziemlich das einfachste sein ^^</p>
<p>Hmm da war wer schneller, aber jtzt hab ichs schon geschrieben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752084</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752084</guid><dc:creator><![CDATA[Hauswurst]]></dc:creator><pubDate>Thu, 30 Jul 2009 08:23:30 GMT</pubDate></item><item><title><![CDATA[Reply to suchen von da bis da on Thu, 30 Jul 2009 08:31:42 GMT]]></title><description><![CDATA[<p>danke erstmal,</p>
<p>das probiere ich aus.</p>
<p>hauswurst: du schreibst break, dann bricht doch das programm da ab. wenn ich aber weiss, dass in dem txt noch einige textmarke1 und ....2 vorkommen werden, kann man das dann so machen, dass das programm dazwischen verarbeitet und dann wieder solange nochmal so ein block kommt wartet und dann wieder weiter macht?<br />
aber sonst vielen dank leute</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752090</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752090</guid><dc:creator><![CDATA[rasidrasid]]></dc:creator><pubDate>Thu, 30 Jul 2009 08:31:42 GMT</pubDate></item><item><title><![CDATA[Reply to suchen von da bis da on Thu, 30 Jul 2009 11:31:18 GMT]]></title><description><![CDATA[<p>Nein break beendet nicht das Programm!</p>
<p>break beendet in diesem Fall einfach nur die Schleife.</p>
<p>Aber google mal nach break und continue. Dann wist bald sehen was das macht <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="🙂"
    /><br />
Wobei hier läuft irgendwo ein netter Mensch rum der mit Links auf die C++ Referenz um sich wirft. Vielleicht hat er ja noch nen Link für dich übrig ^^</p>
<blockquote>
<p>wenn ich aber weiss, dass in dem txt noch einige textmarke1 und ....2 vorkommen werden, kann man das dann so machen, dass das programm dazwischen verarbeitet und dann wieder solange nochmal so ein block kommt wartet und dann wieder weiter macht?</p>
</blockquote>
<p>Selten so einen wirren Satz gelesen :D, aber du willst sicher darauf hinaus, dass textmarke 1 und 2 öfter vorkommen können und dazwischen etwas text oder sonst was liegt.</p>
<p>Einfach das break weg und schon hast was ^^<br />
Wobei du dir auch überlegen könntest XML zu verwenden, dass wäre in einem solchen Fall sehr brauchbar.</p>
<pre><code class="language-cpp">// Alles pseudocode!!!
while ((readline = File.readline ()) != null)
{
  if (readline == textmarke1)
  {
    // ab dem nächsten readline kommen die Zahlen
  }
  if (readline == textmarke2)
  {
    // ab jetzt kommt wieder text oder das ende des Files
  }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1752224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752224</guid><dc:creator><![CDATA[Hauswurst]]></dc:creator><pubDate>Thu, 30 Jul 2009 11:31:18 GMT</pubDate></item><item><title><![CDATA[Reply to suchen von da bis da on Thu, 30 Jul 2009 11:37:05 GMT]]></title><description><![CDATA[<p>danke.</p>
<p>stimmt......ein ganz komischer satz <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752234</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752234</guid><dc:creator><![CDATA[rasidrasid]]></dc:creator><pubDate>Thu, 30 Jul 2009 11:37:05 GMT</pubDate></item></channel></rss>