<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: C++ help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898674#M96585</link>
    <description>Robert,&lt;BR /&gt;I'd read the file, strtok the entries into a malloc, after checking for the first and last fields against the parameters.&lt;BR /&gt;At the end of the file, rewind and output the array.&lt;BR /&gt;&lt;BR /&gt;Also seems you have not updated your earlier thread:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1074999" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1074999&lt;/A&gt;</description>
    <pubDate>Wed, 15 Nov 2006 10:55:36 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2006-11-15T10:55:36Z</dc:date>
    <item>
      <title>C++ help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898673#M96584</link>
      <description>Hello All,&lt;BR /&gt;Below is a file with the following entry.&lt;BR /&gt;and i want to delete following entry from file&lt;BR /&gt;Order of records is the file remain same.&lt;BR /&gt;&lt;BR /&gt;if i give input Owner and passwd2&lt;BR /&gt;it should delete from this file.&lt;BR /&gt;Owner:Group:user:passwd&lt;BR /&gt;Owner:Group:user:passwd1&lt;BR /&gt;Owner:Group:user:passwd2&lt;BR /&gt;Owner:Group:user:passwd3&lt;BR /&gt;Owner1:Group:user:passwd&lt;BR /&gt;Owner2:Group:user:passwd1&lt;BR /&gt;Owner3:Group:user:passwd2&lt;BR /&gt;Owner4:Group:user:passwd3&lt;BR /&gt;&lt;BR /&gt;final output&lt;BR /&gt;Owner:Group:user:passwd&lt;BR /&gt;Owner:Group:user:passwd1&lt;BR /&gt;Owner:Group:user:passwd3&lt;BR /&gt;Owner1:Group:user:passwd&lt;BR /&gt;Owner2:Group:user:passwd1&lt;BR /&gt;Owner3:Group:user:passwd2&lt;BR /&gt;Owner4:Group:user:passwd3&lt;BR /&gt;&lt;BR /&gt;Can somone suggest me by using map ? or any&lt;BR /&gt;other data structure.Well i am against&lt;BR /&gt;using tempfile.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;robert&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Nov 2006 10:05:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898673#M96584</guid>
      <dc:creator>RobertClark</dc:creator>
      <dc:date>2006-11-15T10:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: C++ help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898674#M96585</link>
      <description>Robert,&lt;BR /&gt;I'd read the file, strtok the entries into a malloc, after checking for the first and last fields against the parameters.&lt;BR /&gt;At the end of the file, rewind and output the array.&lt;BR /&gt;&lt;BR /&gt;Also seems you have not updated your earlier thread:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1074999" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1074999&lt;/A&gt;</description>
      <pubDate>Wed, 15 Nov 2006 10:55:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898674#M96585</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-11-15T10:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: C++ help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898675#M96586</link>
      <description>Peter suggests using strtok but you need to make a copy.&lt;BR /&gt;&lt;BR /&gt;Actually there is no need to malloc, you can just filter out each record as you read and then write a new file.  Unless this was excluded by Robert saying "against using tempfile".</description>
      <pubDate>Wed, 15 Nov 2006 17:26:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898675#M96586</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-11-15T17:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: C++ help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898676#M96587</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;this solution with awk&lt;BR /&gt;&lt;BR /&gt;awk -v o=Owner pw=passwd2 -F: 'NF==4 &amp;amp;&amp;amp; !($1==o &amp;amp;&amp;amp; $4==pw)' this_file&lt;BR /&gt;&lt;BR /&gt;'transform' to C. I don't think C++ specific stuff will bring any advantage.&lt;BR /&gt;awk         -&amp;gt;  read file line by line&lt;BR /&gt;-v o=Owner  -&amp;gt;  char *o, *pw;&lt;BR /&gt;-F:         -&amp;gt;  field = strtok(line,":");&lt;BR /&gt;                while (strtok(NULL,":")&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 15 Nov 2006 17:40:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-help/m-p/3898676#M96587</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-11-15T17:40:31Z</dc:date>
    </item>
  </channel>
</rss>

