<?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[IniFile anderes Format]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>kann mir jemand sagen wie ich an die Daten eines IniFiles komme,<br />
wenn in der Kategorie keine Bezeichnung steht:</p>
<pre><code class="language-cpp">[HRData]
69
76
90
105
</code></pre>
<p>und nicht wie normal<br />
puls=69 oder so.</p>
<p>Danke schon mal</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/195865/inifile-anderes-format</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 11:15:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/195865.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 22 Oct 2007 18:36:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to IniFile anderes Format on Mon, 22 Oct 2007 18:36:42 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>kann mir jemand sagen wie ich an die Daten eines IniFiles komme,<br />
wenn in der Kategorie keine Bezeichnung steht:</p>
<pre><code class="language-cpp">[HRData]
69
76
90
105
</code></pre>
<p>und nicht wie normal<br />
puls=69 oder so.</p>
<p>Danke schon mal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390170</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390170</guid><dc:creator><![CDATA[werhilftmir]]></dc:creator><pubDate>Mon, 22 Oct 2007 18:36:42 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Mon, 22 Oct 2007 18:51:53 GMT]]></title><description><![CDATA[<p>Indem du das Ding als gewöhnliche Textdatei öffnest und selbst parst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390181</guid><dc:creator><![CDATA[audacia]]></dc:creator><pubDate>Mon, 22 Oct 2007 18:51:53 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Mon, 22 Oct 2007 19:26:32 GMT]]></title><description><![CDATA[<p>Danke erst mal, ich hatte gehofft es ginge mit ReadSectionValue, damit<br />
scheinen aber nur Werte hinter einem &quot;=&quot; gesucht zu werden.<br />
In dem File sind aber mehrere Sections und ich bräuchte noch einen Tipp<br />
wie ich das mit dem parsen anstelle.</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390197</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390197</guid><dc:creator><![CDATA[werhilftmir]]></dc:creator><pubDate>Mon, 22 Oct 2007 19:26:32 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Mon, 22 Oct 2007 20:02:50 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Öffne die Datei und lies mittels getline die gewünschten Zeilen aus. Diese speicherst du in einen vector von strings und wertest diesen dann aus.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390223</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 22 Oct 2007 20:02:50 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Mon, 22 Oct 2007 20:31:06 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Und genau zu sein ist dafür TStringList am besten geeignet. Siehe SuFu und Builder-Hilfe.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390239</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 22 Oct 2007 20:31:06 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Tue, 23 Oct 2007 08:58:28 GMT]]></title><description><![CDATA[<p>Danke erst mal für die Antworten, nur das mit getline habe ich nicht hinbekommen, ich habe es jetzt so:</p>
<pre><code class="language-cpp">TStringList *TempList = new TStringList;
   TempList-&gt;LoadFromFile(data);
   int index_a=TempList-&gt;IndexOf(&quot;[HRData]&quot;);
   int index_e=400;
   for (int i=index_a+1;i&lt;index_e+index_a;i++)
   {
        if(StrToInt(TempList-&gt;Strings[i].SubString(1,1))&gt;0)
        {
        Memo1-&gt;Lines-&gt;Add(TempList-&gt;Strings[i]);
        }
   }

  delete TempList;
</code></pre>
<p>Ich weiß nicht ob das eleganter geht.Mein Problem ist jetzt das Ende des Files zu finden, das sollte dann index_e werden(ist jetzt eine absolute zahl).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390399</guid><dc:creator><![CDATA[werhilftmir]]></dc:creator><pubDate>Tue, 23 Oct 2007 08:58:28 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Tue, 23 Oct 2007 09:04:19 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>1. getline kannst du bei TStringList und AnsiString nicht einsetzen. brauchst du auch nicht.</p>
<p>2. Ja das ist in Ordnung.</p>
<p>3. Siehe TStringList::Count</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390400</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 23 Oct 2007 09:04:19 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Tue, 23 Oct 2007 09:07:39 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Meine Lösung war halt Standard und nicht auf VCL gemünzt.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390406</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 23 Oct 2007 09:07:39 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Tue, 23 Oct 2007 09:10:19 GMT]]></title><description><![CDATA[<p>1.Vielen Dank für die Hilfe</p>
<p>2.Klasse Forum</p>
<p>3.Wenn ich es irgendwann mal kann helfe ich auch <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/1390408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390408</guid><dc:creator><![CDATA[werhilftmir]]></dc:creator><pubDate>Tue, 23 Oct 2007 09:10:19 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Tue, 23 Oct 2007 09:26:32 GMT]]></title><description><![CDATA[<p>Um nur die Schlüssel einer Ini-Datei zu lesen (auch wenn das Gleichheitszeichen fehlt), gibt es die Methode ReadSection(). Und wenn man die Namen der Abschnitte nicht kennt, kann man sich diese mittels ReadSections() auslesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390417</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Tue, 23 Oct 2007 09:26:32 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Tue, 23 Oct 2007 09:55:02 GMT]]></title><description><![CDATA[<p>Ich habe ReadSections() probiert, aber das liest nur Sektionen und die sind in [] ansonten brachten alle Versuche keine Werte zurück.</p>
<p>ReadSection() gibt alle Werte links vom = zurück, aber nur wenn dieses auch vorhanden ist.</p>
<p>ReadSectionValues() gibt alle Werte rechts vom = zurück, aber auch nur wenn vorhanden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390439</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390439</guid><dc:creator><![CDATA[werhilftmir]]></dc:creator><pubDate>Tue, 23 Oct 2007 09:55:02 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Tue, 23 Oct 2007 15:04:46 GMT]]></title><description><![CDATA[<p>Sorry, dann habe ich mich wohl mit ReadSection() vertan.<br />
Dann mußt du es wie oben beschrieben ausprogrammieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390638</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Tue, 23 Oct 2007 15:04:46 GMT</pubDate></item><item><title><![CDATA[Reply to IniFile anderes Format on Thu, 25 Oct 2007 11:47:19 GMT]]></title><description><![CDATA[<p>Ich mach das so:</p>
<pre><code class="language-cpp">void __fastcall TIniInspectorForm::ShowIniFile(AnsiString AFileName)
{
  AnsiString SName;
  TMemIniFile *IF;
  TTreeNode *SN;
  TTreeNode *KN;
  TStringList *SL=new TStringList;                         //SectionList erzeugen
  TStringList *KL=new TStringList;                         //KeyList erzeugen
  IF=new TMemIniFile(AFileName);                         //Ini- Datei Öffnen
  SB-&gt;SimpleText=&quot;Lese Sectionen&quot;;
  IF-&gt;ReadSections(SL);                                  //Section- Namen einlesen
  KeyList-&gt;Items-&gt;Clear();                               //TreeView löschen
  KeyList-&gt;Update();
  SectionCount-&gt;Caption=0;
  KeyCount-&gt;Caption=&quot; KeyCount&quot;;
  for (int i=0;i&lt;SL-&gt;Count;i++)                          //Alle Section- Namen
  {
    SectionCount-&gt;Caption=SectionCount-&gt;Caption.ToInt()+1;
    SectionCount-&gt;Update();
    SB-&gt;SimpleText=AnsiString(&quot;Lese Section &quot;).operator+=(SL-&gt;Strings[i]);
    SN=KeyList-&gt;Items-&gt;Add(0,SL-&gt;Strings[i]);            //als Hauptknoten einfügen
    KeyList-&gt;Update();
//      IF-&gt;ReadSection(SN-&gt;Text,KL);                        //Keys für Section lesen
    IF-&gt;ReadSectionValues(SN-&gt;Text,KL);                  //Keys und Values für Section lesen
    for (int j=0;j&lt;KL-&gt;Count;j++)                        //Alle Key's
    {
      AnsiString AS;
      KN=KeyList-&gt;Items-&gt;AddChild(SN,KL-&gt;Strings[j]);    //Section- Knoten hinzufügen
//        AS=IF-&gt;ReadString(SN-&gt;Text,KL-&gt;Strings[j],&quot;-&quot;);    //Key- Value lesen
//        KeyList-&gt;Items-&gt;AddChild(KN,AS);                   //Value in neuen Knoten
//        KN-&gt;Text.operator+=(&quot; = &quot;).operator +=(AS);        //Key- Value anhaengen
//        SB-&gt;SimpleText=AnsiString(&quot;Lese Schlüssel [&quot;).operator+=(SL-&gt;Strings[i]).operator+=(&quot;] &quot;).operator+=(KL-&gt;Strings[j]).operator+=(&quot; = &quot;).operator+=(AS);
      SB-&gt;SimpleText=AnsiString(&quot;Lese Schlüssel [&quot;).operator+=(SL-&gt;Strings[i]).operator+=(&quot;] &quot;).operator+=(KL-&gt;Strings[j]);
      KN-&gt;ImageIndex=1;
      KN-&gt;SelectedIndex=2;
    }
  }
  SectionCount-&gt;Caption=SectionCount-&gt;Caption.operator+=(&quot; Sections&quot;);
  SectionCount-&gt;Update();
  SL-&gt;Clear();                                           //SectionList leeren
  IF-&gt;GetStrings(SL);                                    //Alle Zeilen einlesen
  delete IF;                                             //IniFile freigeben
  KeyList-&gt;Update();
  SName=&quot;[] &quot;;
  for (int i=0;i&lt;SL-&gt;Count;i++)                          //Alle Zeilen Testen
  {
    SB-&gt;SimpleText=AnsiString(&quot;Teste Zeile &quot;).operator+=(SL-&gt;Strings[i]);
    if (SL-&gt;Strings[i].Length()==0)                      //Leerzeilen
    {  SL-&gt;Delete(i);                                    //entfernen
       i--;
    }
    else
    {
      if (SL-&gt;Strings[i][1]=='[')                        //SectionNamen
      { SName=SL-&gt;Strings[i];                            //Sectionname speichern
        SL-&gt;Delete(i);                                   //entfernen
        i--;
      }
      else
      { if (SL-&gt;Strings[i].AnsiPos(&quot;=&quot;)&gt;0)               //gueltige Schluessel
        {  SL-&gt;Delete(i);                                //entfernen
          i--;
        }
        else
        {
          SL-&gt;Strings[i]=SName.operator+=(&quot; &quot;).operator+=(SL-&gt;Strings[i]);
        }
      }
    }
  }
  NoKeyList-&gt;Text=SL-&gt;Text;                              //Liste in Memo anzeigen
  SB-&gt;SimpleText=AnsiString(&quot;Einlesen beendet&quot;);
  delete KL;
  delete SL;
  KeyList-&gt;Invalidate();
  NoKeyList-&gt;Invalidate();
}
</code></pre>
<p>!!! Es wird direkt auf Komponenten des Formulars zugegriffen !!!<br />
Die müssen natürlich auch mit den Namen existieren.</p>
<p>Die &quot;ungültigen&quot; Schlüssel kommen in ein Memo<br />
Die gültigen in ein TreeView</p>
<p>Gruss<br />
Frank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1391796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1391796</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Thu, 25 Oct 2007 11:47:19 GMT</pubDate></item></channel></rss>