<?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 Stickey NUL issue ... sed/grep/awk ... perl in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895751#M99665</link>
    <description>Hi, folks,&lt;BR /&gt;&lt;BR /&gt;How do I (1) detect and (2) replace a mid-line null, such as:&lt;BR /&gt;&lt;BR /&gt;This is a li^@ne in a text file ...&lt;BR /&gt;&lt;BR /&gt;Where the ^@ is a NUL character?</description>
    <pubDate>Tue, 12 Apr 2005 07:40:59 GMT</pubDate>
    <dc:creator>A. Daniel King_1</dc:creator>
    <dc:date>2005-04-12T07:40:59Z</dc:date>
    <item>
      <title>Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895751#M99665</link>
      <description>Hi, folks,&lt;BR /&gt;&lt;BR /&gt;How do I (1) detect and (2) replace a mid-line null, such as:&lt;BR /&gt;&lt;BR /&gt;This is a li^@ne in a text file ...&lt;BR /&gt;&lt;BR /&gt;Where the ^@ is a NUL character?</description>
      <pubDate>Tue, 12 Apr 2005 07:40:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895751#M99665</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2005-04-12T07:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895752#M99666</link>
      <description>Post following.&lt;BR /&gt;cat "file" | od -c&lt;BR /&gt;cat file | vis&lt;BR /&gt;&lt;BR /&gt;Would like to look at how it looks like.</description>
      <pubDate>Tue, 12 Apr 2005 08:00:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895752#M99666</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-04-12T08:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895753#M99667</link>
      <description>cat /tmp/1.txt | od -c&lt;BR /&gt;0000000    T   h   i   s       i   s  \0   t   h   e       f   i   l   e&lt;BR /&gt;0000020    .&lt;BR /&gt;0000021&lt;BR /&gt;&lt;BR /&gt;cat /tmp/1.txt | vis&lt;BR /&gt;This is\000the file.</description>
      <pubDate>Tue, 12 Apr 2005 08:03:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895753#M99667</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2005-04-12T08:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895754#M99668</link>
      <description>In awk, I think you could do:&lt;BR /&gt;&lt;BR /&gt;{idx1=index($0,"\0");&lt;BR /&gt; if (idx1==0) {print $0;next}&lt;BR /&gt; newstring=substr($0,1,index-1)substr($0,index+1);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Apr 2005 08:08:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895754#M99668</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-04-12T08:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895755#M99669</link>
      <description>cat file | tr "\000" "\xxx"&lt;BR /&gt;&lt;BR /&gt;xxx is ascii char you want to replace 000 with. man ascii for details.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Tue, 12 Apr 2005 08:08:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895755#M99669</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-04-12T08:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895756#M99670</link>
      <description>Let's try that again:&lt;BR /&gt;&lt;BR /&gt;In awk, I think you could do:&lt;BR /&gt;&lt;BR /&gt;{idx1=index($0,"\0");&lt;BR /&gt;if (idx1==0) {print $0;next}&lt;BR /&gt;newstring=substr($0,1,index-1)substr($0,index+1); print newstring;&lt;BR /&gt;}</description>
      <pubDate>Tue, 12 Apr 2005 08:09:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895756#M99670</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-04-12T08:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895757#M99671</link>
      <description>I like tr -d best myself, but it all works:&lt;BR /&gt;&lt;BR /&gt;# perl -e 'printf "Thisis%cthefile\n",0' &amp;gt; x&lt;BR /&gt;# cat x&lt;BR /&gt;Thisisthefile&lt;BR /&gt;# od -c x&lt;BR /&gt;0000000   T   h   i   s   i   s  \0   t   h   e   f   i   l   e  \n&lt;BR /&gt;#&lt;BR /&gt;# perl -pe 's/\0//' x | od -c &lt;BR /&gt;0000000   T   h   i   s   i   s   t   h   e   f   i   l   e  \n&lt;BR /&gt;#&lt;BR /&gt;# cat x | tr -d "\000"  | od -c&lt;BR /&gt;0000000   T   h   i   s   i   s   t   h   e   f   i   l   e  \n&lt;BR /&gt;#&lt;BR /&gt;# awk '{gsub(/\000/,""); print}' x | od -c&lt;BR /&gt;0000000   T   h   i   s   i   s   t   h   e   f   i   l   e  \n&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Apr 2005 09:46:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895757#M99671</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-04-12T09:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stickey NUL issue ... sed/grep/awk ... perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895758#M99672</link>
      <description>awk had trouble, I ended up using perl, and I really like the vis and tr solutions.</description>
      <pubDate>Mon, 22 May 2006 13:40:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/stickey-nul-issue-sed-grep-awk-perl/m-p/4895758#M99672</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2006-05-22T13:40:42Z</dc:date>
    </item>
  </channel>
</rss>

