<?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[Frage zur Formatierung]]></title><description><![CDATA[<p>Hallo</p>
<p>Lese Daten von einem GPS Empfänger ein und will diese in eine TXT Datei speichern.</p>
<p>Meine Frage wie kann ich die Daten Protokolle formatieren.</p>
<p>Das Startzeichen ist ein $ das Ende Zeichen ein LF.</p>
<p>So kommen die Daten jetzt and</p>
<p>213123,821312 E,1313,12312,123123,1*49<br />
3312<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>G</mi><mi>M</mi><mi>C</mi><mn>3</mn><mn>3</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>N</mi><mo separator="true">,</mo><mi>w</mi><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>E</mi><mo separator="true">,</mo><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mn>1</mn><mn>2</mn><mn>3</mn><mn>2</mn><mn>1</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo>∗</mo><mn>8</mn><mn>7</mn></mrow><annotation encoding="application/x-tex">GMC3313121312N,w12312312E,3123,,,,,,12321,,,*87  
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.8777699999999999em;vertical-align:-0.19444em;"></span><span class="base textstyle uncramped"><span class="mord mathit">G</span><span class="mord mathit" style="margin-right:0.10903em;">M</span><span class="mord mathit" style="margin-right:0.07153em;">C</span><span class="mord mathrm">3</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mpunct">,</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mpunct">,</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord">∗</span><span class="mord mathrm">8</span><span class="mord mathrm">7</span></span></span></span>RMC13112312,123,,,12312,3,,,12312,,,,,*4D<br />
usw.</p>
<p>So solls dann ausehen</p>
<p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>G</mi><mi>M</mi><mi>C</mi><mn>3</mn><mn>3</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>N</mi><mo separator="true">,</mo><mi>w</mi><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>E</mi><mo separator="true">,</mo><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mn>1</mn><mn>2</mn><mn>3</mn><mn>2</mn><mn>1</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo>∗</mo><mn>8</mn><mn>7</mn></mrow><annotation encoding="application/x-tex">GMC3313121312N,w12312312E,3123,,,,,,12321,,,*87  
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.8777699999999999em;vertical-align:-0.19444em;"></span><span class="base textstyle uncramped"><span class="mord mathit">G</span><span class="mord mathit" style="margin-right:0.10903em;">M</span><span class="mord mathit" style="margin-right:0.07153em;">C</span><span class="mord mathrm">3</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mpunct">,</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mpunct">,</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord">∗</span><span class="mord mathrm">8</span><span class="mord mathrm">7</span></span></span></span>RMC13112312,123,,,12312,3,,,12312,,,,,*4D<br />
$VTG123123,12312,3,21,312,3,123,*6T</p>
<p>usw.</p>
<p>Vielen Dank</p>
<p>Herrmann</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/129325/frage-zur-formatierung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 04:56:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129325.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Dec 2005 17:56:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zur Formatierung on Mon, 12 Dec 2005 17:56:53 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Lese Daten von einem GPS Empfänger ein und will diese in eine TXT Datei speichern.</p>
<p>Meine Frage wie kann ich die Daten Protokolle formatieren.</p>
<p>Das Startzeichen ist ein $ das Ende Zeichen ein LF.</p>
<p>So kommen die Daten jetzt and</p>
<p>213123,821312 E,1313,12312,123123,1*49<br />
3312<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>G</mi><mi>M</mi><mi>C</mi><mn>3</mn><mn>3</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>N</mi><mo separator="true">,</mo><mi>w</mi><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>E</mi><mo separator="true">,</mo><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mn>1</mn><mn>2</mn><mn>3</mn><mn>2</mn><mn>1</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo>∗</mo><mn>8</mn><mn>7</mn></mrow><annotation encoding="application/x-tex">GMC3313121312N,w12312312E,3123,,,,,,12321,,,*87  
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.8777699999999999em;vertical-align:-0.19444em;"></span><span class="base textstyle uncramped"><span class="mord mathit">G</span><span class="mord mathit" style="margin-right:0.10903em;">M</span><span class="mord mathit" style="margin-right:0.07153em;">C</span><span class="mord mathrm">3</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mpunct">,</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mpunct">,</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord">∗</span><span class="mord mathrm">8</span><span class="mord mathrm">7</span></span></span></span>RMC13112312,123,,,12312,3,,,12312,,,,,*4D<br />
usw.</p>
<p>So solls dann ausehen</p>
<p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>G</mi><mi>M</mi><mi>C</mi><mn>3</mn><mn>3</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>1</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>N</mi><mo separator="true">,</mo><mi>w</mi><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mn>1</mn><mn>2</mn><mi>E</mi><mo separator="true">,</mo><mn>3</mn><mn>1</mn><mn>2</mn><mn>3</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mn>1</mn><mn>2</mn><mn>3</mn><mn>2</mn><mn>1</mn><mo separator="true">,</mo><mo separator="true">,</mo><mo separator="true">,</mo><mo>∗</mo><mn>8</mn><mn>7</mn></mrow><annotation encoding="application/x-tex">GMC3313121312N,w12312312E,3123,,,,,,12321,,,*87  
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.8777699999999999em;vertical-align:-0.19444em;"></span><span class="base textstyle uncramped"><span class="mord mathit">G</span><span class="mord mathit" style="margin-right:0.10903em;">M</span><span class="mord mathit" style="margin-right:0.07153em;">C</span><span class="mord mathrm">3</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="mpunct">,</span><span class="mord mathit" style="margin-right:0.02691em;">w</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathit" style="margin-right:0.05764em;">E</span><span class="mpunct">,</span><span class="mord mathrm">3</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord mathrm">1</span><span class="mord mathrm">2</span><span class="mord mathrm">3</span><span class="mord mathrm">2</span><span class="mord mathrm">1</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mpunct">,</span><span class="mord">∗</span><span class="mord mathrm">8</span><span class="mord mathrm">7</span></span></span></span>RMC13112312,123,,,12312,3,,,12312,,,,,*4D<br />
$VTG123123,12312,3,21,312,3,123,*6T</p>
<p>usw.</p>
<p>Vielen Dank</p>
<p>Herrmann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/940441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/940441</guid><dc:creator><![CDATA[herrmannA]]></dc:creator><pubDate>Mon, 12 Dec 2005 17:56:53 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zur Formatierung on Mon, 12 Dec 2005 18:00:53 GMT]]></title><description><![CDATA[<p>Du kannst die Daten in einem String speichern und dort nach $ bzw \n suchen, um die richtigen Teile auszuschneiden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/940444</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/940444</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 12 Dec 2005 18:00:53 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zur Formatierung on Mon, 12 Dec 2005 21:30:56 GMT]]></title><description><![CDATA[<p>Hallo Herrmann,</p>
<p>Du kannst die Zeichen von einem Pacman fressen lassen <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="😉"
    /></p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

class Pacman
{
public:
    enum state_t { idle, store };
    Pacman( std::ostream&amp; out ) : m_state( idle ), m_out( out ) {}
    void friss( char z );
private:
    state_t m_state;
    std::ostream&amp; m_out;

    static const char start = '$';
    static const char end = '\n';
};

void Pacman::friss( char z )
{
    switch( m_state )
    {
    case idle:

        if( z == start )
        {
            m_out &lt;&lt; z;
            m_state = store;
        }
        break;

    case store:
        if( z == end )
        {
            m_state = idle;
            m_out &lt;&lt; std::endl;
        }
        else
        {
            m_out &lt;&lt; z;
        }
        break;
    default:
        // ???
        break;
    }
}
</code></pre>
<p>kleines Test-Programm dazu:</p>
<pre><code class="language-cpp">#include &lt;algorithm&gt;
#include &lt;functional&gt;
#include &lt;fstream&gt;

int main()
{
    using namespace std;
    const char input[] = 
        &quot;213123,821312 E,1313,12312,123123,1*49\n&quot;
        &quot;3312$GMC3313121312N,w12312312E,3123,,,,,,12321,,,*87\n&quot;
        &quot;$RMC13112312,123,,,12312,3,,,12312,,,,,*4D\n&quot;
        &quot;$VTG123123,12312,3,21,312,3,123,*6T\nquatsch&quot;;
    ofstream file(&quot;output.txt&quot;);
    Pacman pac( file );
    for_each( input, input + strlen(input), bind1st( mem_fun( &amp;Pacman::friss ), &amp;pac ) );
    return 0;
}
</code></pre>
<p>:xmas2: Werner</p>
<p>Edit: break vergessen ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/940667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/940667</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Mon, 12 Dec 2005 21:30:56 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zur Formatierung on Mon, 12 Dec 2005 21:33:11 GMT]]></title><description><![CDATA[<p>Habe es danke urer hilfe hinbekommen.</p>
<p>Vielen Dank</p>
<p>Herrmann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/940672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/940672</guid><dc:creator><![CDATA[herrmannA]]></dc:creator><pubDate>Mon, 12 Dec 2005 21:33:11 GMT</pubDate></item></channel></rss>