<?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: replacing according to position in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977291#M95508</link>
    <description>Hi all,&lt;BR /&gt;Thanks a lot for the help.&lt;BR /&gt;One more query is that, &lt;BR /&gt;is ther any restriction on the no. of characters?&lt;BR /&gt;I mean.. in a line can i change the 260-264th character in the similar manner?&lt;BR /&gt;I hav to achieve that.</description>
    <pubDate>Mon, 09 Apr 2007 23:49:29 GMT</pubDate>
    <dc:creator>Reen</dc:creator>
    <dc:date>2007-04-09T23:49:29Z</dc:date>
    <item>
      <title>replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977284#M95501</link>
      <description>Hi all,&lt;BR /&gt;can anybody help in this&lt;BR /&gt;In a line, i have a pattern tat is to be replaced.&lt;BR /&gt;&lt;BR /&gt;using sed , i can replace in  a particular line, but tat pattern can occur in the line in many other places.&lt;BR /&gt;i want only one instance to be replaced.</description>
      <pubDate>Mon, 09 Apr 2007 05:21:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977284#M95501</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-09T05:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977285#M95502</link>
      <description>Attached is the file.&lt;BR /&gt;I want the 2nd instance of Blore to b replaced in 2nd line.&lt;BR /&gt;But in the actual file am not sure of the occurance of this instance.It can be 3rd instance.&lt;BR /&gt;But the position is fixed.&lt;BR /&gt;so in this case, 23-27 characters in 2nd line to be replaced by Mlore</description>
      <pubDate>Mon, 09 Apr 2007 05:26:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977285#M95502</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-09T05:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977286#M95503</link>
      <description>&amp;gt;using sed, i can replace in a particular line, but that pattern can occur in the line in many other places.  i want only one instance to be replaced.&lt;BR /&gt;&lt;BR /&gt;One instance per line, or one per whole file?&lt;BR /&gt;For the former, don't add "g" to the "s" function, then it only will replace one.&lt;BR /&gt;&lt;BR /&gt;If it is once per file, you'll need to write an awk script.  To replace to the first then copy the rest of the file.</description>
      <pubDate>Mon, 09 Apr 2007 05:28:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977286#M95503</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-09T05:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977287#M95504</link>
      <description>Thanks Dennis.&lt;BR /&gt;Can u give me a solution for my attached file</description>
      <pubDate>Mon, 09 Apr 2007 05:48:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977287#M95504</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-09T05:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977288#M95505</link>
      <description>hi Reen@,&lt;BR /&gt;&lt;BR /&gt;In the vi editor, can you try this:&lt;BR /&gt;:1,$s/.Blore/Mlore&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Apr 2007 06:18:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977288#M95505</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-04-09T06:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977289#M95506</link>
      <description>&amp;gt;Yogeeraj:  1,$s/.Blore/Mlore&lt;BR /&gt;&lt;BR /&gt;You may need to quote the "." otherwise it would match the first:&lt;BR /&gt;:1,$s/\.Blore/Mlore&lt;BR /&gt;&lt;BR /&gt;(But I guess it was safe since there are no chars before the first Blore.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;But the position is fixed.  so in this case, 23-27 characters in 2nd line to be replaced by Mlore&lt;BR /&gt;&lt;BR /&gt;That makes it easy:&lt;BR /&gt;sed -e 's/^\(......................\)Blore/\1Mlore/'&lt;BR /&gt;&lt;BR /&gt;(There should be 22 dots.  The \1 puts them back into the output.  If only one the second line, you can use '2s/'.)</description>
      <pubDate>Mon, 09 Apr 2007 06:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977289#M95506</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-09T06:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977290#M95507</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;A bit more readable (and much easier to maintain) is the specificatino of the number of character repetitions, thusly:&lt;BR /&gt;&lt;BR /&gt;# sed -e 's/^\(.\{22\}\)Blore/\1Mlore/'  &lt;BR /&gt;&lt;BR /&gt;Note that the curly braces must be escaped with a backslash just like the parentheses must be.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 09 Apr 2007 06:50:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977290#M95507</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-04-09T06:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977291#M95508</link>
      <description>Hi all,&lt;BR /&gt;Thanks a lot for the help.&lt;BR /&gt;One more query is that, &lt;BR /&gt;is ther any restriction on the no. of characters?&lt;BR /&gt;I mean.. in a line can i change the 260-264th character in the similar manner?&lt;BR /&gt;I hav to achieve that.</description>
      <pubDate>Mon, 09 Apr 2007 23:49:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977291#M95508</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-09T23:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977292#M95509</link>
      <description>&amp;gt;is there any restriction on the no. of characters?&lt;BR /&gt;&lt;BR /&gt;No, you can use JRF's improvement, and you just type in the number.&lt;BR /&gt;^\(.\{259\}\)</description>
      <pubDate>Mon, 09 Apr 2007 23:57:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977292#M95509</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-09T23:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977293#M95510</link>
      <description>Dennis,&lt;BR /&gt;Didnt get JRF`s improvement???</description>
      <pubDate>Tue, 10 Apr 2007 00:04:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977293#M95510</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-10T00:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977294#M95511</link>
      <description>Ok &lt;BR /&gt;But When i type in 272nd character sed function cannot be parsed error occurs.&lt;BR /&gt;Till 255th character,its fine. &lt;BR /&gt;Cant replace 256th character onwards in a line. Any suggestions?</description>
      <pubDate>Tue, 10 Apr 2007 00:09:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977294#M95511</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-10T00:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977295#M95512</link>
      <description>&amp;gt;Didnt get JRF`s improvement???&lt;BR /&gt;&lt;BR /&gt;Instead of typing 22 "."s, you can use: .\{22\} &lt;BR /&gt;&lt;BR /&gt;If you are happy with your answers, please read: &lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;</description>
      <pubDate>Tue, 10 Apr 2007 00:13:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977295#M95512</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-10T00:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977296#M95513</link>
      <description>But Dennis,&lt;BR /&gt;I cant replace 272-275th character..</description>
      <pubDate>Tue, 10 Apr 2007 00:23:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977296#M95513</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-10T00:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977297#M95514</link>
      <description>&amp;gt;But when i type in 272nd character sed function cannot be parsed error occurs.  Till 255th character, it's fine.&lt;BR /&gt;&lt;BR /&gt;Ah, that limit is documented under regexp(5).&lt;BR /&gt;&lt;BR /&gt;You are going to have to do addition:&lt;BR /&gt;$ sed -e 's/^\(.\{200\}.\{71\}\)Blore/\1Mlore/'</description>
      <pubDate>Tue, 10 Apr 2007 00:59:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977297#M95514</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-10T00:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: replacing according to position</title>
      <link>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977298#M95515</link>
      <description>Hey... tats cool&lt;BR /&gt;&lt;BR /&gt;thanks a lot... &lt;BR /&gt;got the solution!</description>
      <pubDate>Tue, 10 Apr 2007 04:25:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/replacing-according-to-position/m-p/3977298#M95515</guid>
      <dc:creator>Reen</dc:creator>
      <dc:date>2007-04-10T04:25:01Z</dc:date>
    </item>
  </channel>
</rss>

