<?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: Adding column in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114840#M91952</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One way:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/(.{13})/$1\*/' file&lt;BR /&gt;&lt;BR /&gt;...and if you want to update in-place do:&lt;BR /&gt;&lt;BR /&gt;# perl -pi -e 's/(.{13})/$1\*/' file &lt;BR /&gt;&lt;BR /&gt;Note that Perl counts from zero, so the fisrt column is 0.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 19 Jun 2008 10:49:37 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-06-19T10:49:37Z</dc:date>
    <item>
      <title>Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114839#M91951</link>
      <description>i have the file in below format.&lt;BR /&gt;0364120000013502000117186270*805&lt;BR /&gt;0323120000013502200115594152*805&lt;BR /&gt;0438120000013502400107398174*805&lt;BR /&gt;0364120000013502500106634595*805&lt;BR /&gt;&lt;BR /&gt;i need the o/p file  &lt;BR /&gt;03641200000135*02000117186270*805&lt;BR /&gt;03231200000135*02200115594152*805&lt;BR /&gt;04381200000135*02400107398174*805&lt;BR /&gt;03641200000135*02500106634595*805&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried sed command but unable to do it.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advanced.</description>
      <pubDate>Thu, 19 Jun 2008 09:54:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114839#M91951</guid>
      <dc:creator>Panpalia</dc:creator>
      <dc:date>2008-06-19T09:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114840#M91952</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One way:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/(.{13})/$1\*/' file&lt;BR /&gt;&lt;BR /&gt;...and if you want to update in-place do:&lt;BR /&gt;&lt;BR /&gt;# perl -pi -e 's/(.{13})/$1\*/' file &lt;BR /&gt;&lt;BR /&gt;Note that Perl counts from zero, so the fisrt column is 0.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 19 Jun 2008 10:49:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114840#M91952</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-06-19T10:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114841#M91953</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Oops, I can't count:&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/(.{14})/$1\*/' file&lt;BR /&gt;&lt;BR /&gt;# perl -pi -e 's/(.{14})/$1\*/' file &lt;BR /&gt;&lt;BR /&gt;...to update inplace&lt;BR /&gt;&lt;BR /&gt;(or):&lt;BR /&gt;&lt;BR /&gt;sed -e 's/\(.\{14\}\)/\1\*/' file&lt;BR /&gt;&lt;BR /&gt;...as the firt Perl's counterpart.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Jun 2008 10:58:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114841#M91953</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-06-19T10:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114842#M91954</link>
      <description>while read a b c&lt;BR /&gt;do&lt;BR /&gt; e=${b#???}&lt;BR /&gt; eval "f=${b%$e}"&lt;BR /&gt; echo $a $f\*$e&lt;BR /&gt;done &lt;FILEIN&gt;fileout&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;awk '{printf("%s %s*%s\n", $1, substr($2,1,3),substr($2,4)) }' &lt;FILEIN&gt;fileout&lt;BR /&gt;&lt;BR /&gt;of if it is always 135&lt;BR /&gt;while read a b c&lt;BR /&gt;do&lt;BR /&gt; e=${b#135}&lt;BR /&gt; echo $a 135\*$e&lt;BR /&gt;done &lt;FILEIN&gt;fileout&lt;BR /&gt;&lt;BR /&gt;&lt;/FILEIN&gt;&lt;/FILEIN&gt;&lt;/FILEIN&gt;</description>
      <pubDate>Thu, 19 Jun 2008 11:06:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114842#M91954</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2008-06-19T11:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114843#M91955</link>
      <description>&lt;!--!*#--&gt;td192&amp;gt; cat n.dat&lt;BR /&gt;0364120000013502000117186270*805&lt;BR /&gt;0323120000013502200115594152*805&lt;BR /&gt;0438120000013502400107398174*805&lt;BR /&gt;0364120000013502500106634595*805&lt;BR /&gt;&lt;BR /&gt;td192&amp;gt; &amp;lt; n.dat sed -e 's/^\(..............\)/\1*/'&lt;BR /&gt;03641200000135*02000117186270*805&lt;BR /&gt;03231200000135*02200115594152*805&lt;BR /&gt;04381200000135*02400107398174*805&lt;BR /&gt;03641200000135*02500106634595*805</description>
      <pubDate>Thu, 19 Jun 2008 12:24:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114843#M91955</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-06-19T12:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114844#M91956</link>
      <description>The sed command (sed -e 's/\(.\{14\}\)/\1\*/' file) is working fine.&lt;BR /&gt;&lt;BR /&gt;Now how to remove the added * from Outfile to get initial file</description>
      <pubDate>Thu, 19 Jun 2008 12:49:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114844#M91956</guid>
      <dc:creator>Panpalia</dc:creator>
      <dc:date>2008-06-19T12:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114845#M91957</link>
      <description>&amp;gt; Now how to remove [...]&lt;BR /&gt;&lt;BR /&gt;Hire someone who can read "man sed" (and&lt;BR /&gt;think)?</description>
      <pubDate>Thu, 19 Jun 2008 12:56:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114845#M91957</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-06-19T12:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114846#M91958</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The sed command (sed -e 's/\(.\{14\}\)/\1\*/' file) is working fine.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Now how to remove the added * from Outfile to get initial file&lt;BR /&gt;&lt;BR /&gt;Then:&lt;BR /&gt;&lt;BR /&gt;# sed -e 's/\*//' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 19 Jun 2008 12:58:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114846#M91958</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-06-19T12:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adding column</title>
      <link>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114847#M91959</link>
      <description>Thanks!</description>
      <pubDate>Fri, 20 Jun 2008 10:16:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/adding-column/m-p/5114847#M91959</guid>
      <dc:creator>Panpalia</dc:creator>
      <dc:date>2008-06-20T10:16:02Z</dc:date>
    </item>
  </channel>
</rss>

