<?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[Parameter von Zeilen lesen und ins varibalen schreiben]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe eine Datei. In jeder Zeile der Datei sind Parameter gespeichert , getrennt durch Tab.z.B Parm1 \t Parm2 \<br />
Ich möchte nun die Parms in eine Var-Array schreiben. Wie mache ich das ? Mein code:</p>
<pre><code>FILE *f;
	char line[100],var1[32], var2[16];
	int i; 

	if ((f = fopen(&quot;file.txt&quot;, &quot;r&quot;)) == NULL) {
		MessageBox(hWnd,L&quot;could not open file.txt&quot;,L&quot;Error&quot;,MB_OK|MB_ICONINFORMATION);
		return -1;
	}
	i = 0;
	while ((fscanf(f,&quot;%s\n&quot;,&amp;line)) != EOF )
	{

		if (sscanf(line, &quot; %[^@]@%s&quot;, var1, var2) == 2)  // hier weiss ich nicht genau
		{ 
printf(&quot;...&quot;);
i++;
		} 
		else
		{
			MessageBox(hWnd,L&quot;no match&quot;,L&quot;Info&quot;,MB_OK|MB_ICONINFORMATION);
		}
	}

	fclose(f);
	return 0;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/207255/parameter-von-zeilen-lesen-und-ins-varibalen-schreiben</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 22:18:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/207255.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Mar 2008 12:46:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Parameter von Zeilen lesen und ins varibalen schreiben on Wed, 05 Mar 2008 12:46:46 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe eine Datei. In jeder Zeile der Datei sind Parameter gespeichert , getrennt durch Tab.z.B Parm1 \t Parm2 \<br />
Ich möchte nun die Parms in eine Var-Array schreiben. Wie mache ich das ? Mein code:</p>
<pre><code>FILE *f;
	char line[100],var1[32], var2[16];
	int i; 

	if ((f = fopen(&quot;file.txt&quot;, &quot;r&quot;)) == NULL) {
		MessageBox(hWnd,L&quot;could not open file.txt&quot;,L&quot;Error&quot;,MB_OK|MB_ICONINFORMATION);
		return -1;
	}
	i = 0;
	while ((fscanf(f,&quot;%s\n&quot;,&amp;line)) != EOF )
	{

		if (sscanf(line, &quot; %[^@]@%s&quot;, var1, var2) == 2)  // hier weiss ich nicht genau
		{ 
printf(&quot;...&quot;);
i++;
		} 
		else
		{
			MessageBox(hWnd,L&quot;no match&quot;,L&quot;Info&quot;,MB_OK|MB_ICONINFORMATION);
		}
	}

	fclose(f);
	return 0;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1468747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468747</guid><dc:creator><![CDATA[vitronix]]></dc:creator><pubDate>Wed, 05 Mar 2008 12:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to Parameter von Zeilen lesen und ins varibalen schreiben on Wed, 05 Mar 2008 14:57:09 GMT]]></title><description><![CDATA[<p>E funktioniert jetzt zwar mit (sscanf(line,&quot;%s\t%s\r\n&quot;, var1, var2) == 2)., aber ich habe Problem mit Leerzeichen in Varibalen. ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468831</guid><dc:creator><![CDATA[vitronix]]></dc:creator><pubDate>Wed, 05 Mar 2008 14:57:09 GMT</pubDate></item></channel></rss>