<?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: Another Inquiry in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993424#M100541</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;it's stiil not clear for me:&lt;BR /&gt;This result:&lt;BR /&gt;1)&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Program Name,XXX&lt;BR /&gt;Program Version,YY&lt;BR /&gt;Stage,1&lt;BR /&gt;Operator,1234&lt;BR /&gt;&lt;BR /&gt;or that:&lt;BR /&gt;2)&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Program Name,ZZZZZ&lt;BR /&gt;Program Version,TTTTTT&lt;BR /&gt;Stage,1&lt;BR /&gt;Operator,1234&lt;BR /&gt;&lt;BR /&gt;A solution will severely depend on that.&lt;BR /&gt;&lt;BR /&gt;mfg Peter</description>
    <pubDate>Thu, 27 Jul 2006 04:21:10 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2006-07-27T04:21:10Z</dc:date>
    <item>
      <title>Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993421#M100538</link>
      <description>Dear Gurus,&lt;BR /&gt;&lt;BR /&gt;Another inquiry on file manipulation....&lt;BR /&gt;I have a file (more than 10000+) and i need to insert the following line with it.&lt;BR /&gt;&lt;BR /&gt;Program Name,XXXXX&lt;BR /&gt;Program Version,YYYYYY&lt;BR /&gt;Stage,1&lt;BR /&gt;&lt;BR /&gt;My file currently contains the following info:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Operator,1234&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;I need to insert between the Product Name and Operator the following: &lt;BR /&gt;&lt;BR /&gt;Program Name,XXXXX&lt;BR /&gt;Program Version,YYYYYY&lt;BR /&gt;Stage,1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Such that my file will look like this:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Program Name,XXXXX&lt;BR /&gt;Program Version,YYYYYY&lt;BR /&gt;Stage,1&lt;BR /&gt;Operator,1234&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Maximum point to all correct replies.&lt;BR /&gt;Thanks!</description>
      <pubDate>Thu, 27 Jul 2006 01:10:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993421#M100538</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-27T01:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993422#M100539</link>
      <description>You need to explain better where you get the inserted 3 lines.  Are the 3 lines fixed?  Or are they composed of parts of lines from the original file.&lt;BR /&gt;&lt;BR /&gt;Product Name, $X/$Y&lt;BR /&gt;Program Name,$X&lt;BR /&gt;Program Version,$Y&lt;BR /&gt;Stage,1&lt;BR /&gt;&lt;BR /&gt;Do you need to copy the above $X and $Y strings to the inserted lines?</description>
      <pubDate>Thu, 27 Jul 2006 01:48:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993422#M100539</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-07-27T01:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993423#M100540</link>
      <description>&lt;BR /&gt;Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;The 3 lines are fixed at the moment. or I was thinking of putting it in a file (3 lines) and merge it with the file provided that my file content will still look like this.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Program Name,XXXXX&lt;BR /&gt;Program Version,YYYYYY&lt;BR /&gt;Stage,1&lt;BR /&gt;Operator,1234&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;On your inquiry.&lt;BR /&gt;&lt;BR /&gt;Do you need to copy the above $X and $Y strings to the inserted lines? Yes.&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jul 2006 02:43:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993423#M100540</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-27T02:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993424#M100541</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;it's stiil not clear for me:&lt;BR /&gt;This result:&lt;BR /&gt;1)&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Program Name,XXX&lt;BR /&gt;Program Version,YY&lt;BR /&gt;Stage,1&lt;BR /&gt;Operator,1234&lt;BR /&gt;&lt;BR /&gt;or that:&lt;BR /&gt;2)&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Program Name,ZZZZZ&lt;BR /&gt;Program Version,TTTTTT&lt;BR /&gt;Stage,1&lt;BR /&gt;Operator,1234&lt;BR /&gt;&lt;BR /&gt;A solution will severely depend on that.&lt;BR /&gt;&lt;BR /&gt;mfg Peter</description>
      <pubDate>Thu, 27 Jul 2006 04:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993424#M100541</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-07-27T04:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993425#M100542</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;The output should be:&lt;BR /&gt;&lt;BR /&gt;Product Name,XXX/YY&lt;BR /&gt;Program Name,ZZZZZ&lt;BR /&gt;Program Version,TTTTTT&lt;BR /&gt;Stage,1&lt;BR /&gt;Operator,1234&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jul 2006 15:56:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993425#M100542</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-27T15:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993426#M100543</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If I understand correctly, this should do what you ask:&lt;BR /&gt;&lt;BR /&gt;# cat inserter&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    print;&lt;BR /&gt;    if (m/^Product Name/) {&lt;BR /&gt;        print "Program Name,ZZZZZ\n";&lt;BR /&gt;        print "Program Version,TTTTTT\n";&lt;BR /&gt;        print "Stage,1\n";&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./inserter file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 27 Jul 2006 16:30:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993426#M100543</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-07-27T16:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993427#M100544</link>
      <description>imho here's a solution if my understanding of your requirement is correct i.e. f2 is the file that contains the 3 lines and f1 is the file (10000+ lines) into which those 3 lines have to be inserted&lt;BR /&gt;&lt;BR /&gt;# cat f1&lt;BR /&gt;...&lt;BR /&gt;Product Name, XXX/YY&lt;BR /&gt;Operator,1234&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;# cat f2&lt;BR /&gt;Program Name,XXXXX&lt;BR /&gt;Program Version,YYYYYY&lt;BR /&gt;Stage,1&lt;BR /&gt;&lt;BR /&gt;use this ex construct...&lt;BR /&gt;&lt;BR /&gt;# ex -s +'/^Product Name, XXX\/YY$/r f2 | wq' f1</description>
      <pubDate>Thu, 27 Jul 2006 18:10:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993427#M100544</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-07-27T18:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993428#M100545</link>
      <description>Hi JRF,&lt;BR /&gt;&lt;BR /&gt;I've tested your script and the result does not change the file though the output at the screen is the right one. I need to change the file also just as the output at the screen.&lt;BR /&gt;&lt;BR /&gt;Also, I can call the perl script you made from any other script, right?&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Jul 2006 21:57:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993428#M100545</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-27T21:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993429#M100546</link>
      <description>Hello Sandman!,&lt;BR /&gt;&lt;BR /&gt;Sorry for the confusion. I have files (10000+) that needs to be change. I have tested the ex command and it actually, outputted the way i wanted to. But when i put it inside my script,&lt;BR /&gt;it ask for a key?</description>
      <pubDate>Thu, 27 Jul 2006 22:01:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993429#M100546</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-27T22:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993430#M100547</link>
      <description>&lt;!--!*#--&gt;Hi Pando,&lt;BR /&gt;&lt;BR /&gt;I put the ex command inside a script too and it runs fine doesn't ask for a key. Could you attach your script here so it can be looked at. Also if you need to process 10000+ files simply put the ex command inside a for-loop i.e.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;for i in $(ls -1 &lt;DIR_HAVING_10000&gt;)&lt;BR /&gt;do&lt;BR /&gt;  ex -s +'/^Product Name, XXX\/YY$/r insertfile | wq' $i&lt;BR /&gt;done&lt;/DIR_HAVING_10000&gt;</description>
      <pubDate>Fri, 28 Jul 2006 00:11:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993430#M100547</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-07-28T00:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993431#M100548</link>
      <description>Hello Sandman!,&lt;BR /&gt;&lt;BR /&gt;Please see attched script and some raw file. This also includes the file that needs to be inserted. &lt;BR /&gt;In the script, i have changed/replaced the /^Product Name,XXX/YY$/ to /^Diffusion Lot ID,NA$/ (Kindly check the raw data) because the Diffusion Lot ID is more fixed.&lt;BR /&gt;Thanks and hoping to hear from you soon.</description>
      <pubDate>Fri, 28 Jul 2006 02:22:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993431#M100548</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-28T02:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993432#M100549</link>
      <description>Hello Sandman!,&lt;BR /&gt;&lt;BR /&gt;Please see attached script and some raw file (zipped format). This also includes the file that needs to be inserted (integ) to the 3 file  with TDF extension. &lt;BR /&gt;In the script, i have changed/replaced the /^Product Name,XXX/YY$/ to /^Diffusion Lot ID,NA$/ (Kindly check the raw data) because the Diffusion Lot ID is more fixed.&lt;BR /&gt;Thanks and hoping to hear from you soon.</description>
      <pubDate>Fri, 28 Jul 2006 02:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993432#M100549</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-28T02:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993433#M100550</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;a short one to test:&lt;BR /&gt;File content before:&lt;BR /&gt;cat /tmp/x&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;cc&lt;BR /&gt;aa&lt;BR /&gt;dd&lt;BR /&gt;gg&lt;BR /&gt;&lt;BR /&gt;Running the command&lt;BR /&gt;perl -i -e 'while (&amp;lt;&amp;gt;) { if($f) {print "xx\nyy\n";$f=0;} print; chomp; if ($_ eq "aa") { $f=1} }' /tmp/x&lt;BR /&gt;&lt;BR /&gt;results in&lt;BR /&gt;cat /tmp/x&lt;BR /&gt;aa&lt;BR /&gt;xx&lt;BR /&gt;yy&lt;BR /&gt;bb&lt;BR /&gt;cc&lt;BR /&gt;aa&lt;BR /&gt;xx&lt;BR /&gt;yy&lt;BR /&gt;dd&lt;BR /&gt;gg&lt;BR /&gt;&lt;BR /&gt;Perhaps this is enough - just change the conditions for inserting as needed.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 28 Jul 2006 03:26:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993433#M100550</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-07-28T03:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993434#M100551</link>
      <description>Hi Pando, &lt;BR /&gt;just 2 suggestions:&lt;BR /&gt;1. writing the subject line clearly will give good fast response and while searching it will help a lot.&lt;BR /&gt;2. submit points to those who helped you.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Jul 2006 03:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993434#M100551</guid>
      <dc:creator>inventsekar_1</dc:creator>
      <dc:date>2006-07-28T03:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993435#M100552</link>
      <description>Thanks to all replies!</description>
      <pubDate>Fri, 28 Jul 2006 09:27:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993435#M100552</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-28T09:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993436#M100553</link>
      <description>&lt;!--!*#--&gt;Hi (again) Pando:&lt;BR /&gt;&lt;BR /&gt;If you want to update the file "in-place" while creating a backup copy with the extension '.old', use this variation of my script.&lt;BR /&gt;&lt;BR /&gt;# cat inserter&lt;BR /&gt;#!/usr/bin/perl -i.old&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    print;&lt;BR /&gt;    if (m/^Product Name/) {&lt;BR /&gt;        print "Program Name,ZZZZZ\n";&lt;BR /&gt;        print "Program Version,TTTTTT\n";&lt;BR /&gt;        print "Stage,1\n";&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./inserter file&lt;BR /&gt;&lt;BR /&gt;No output occurs to your terminal.  You can 'cat' the modified file when done.  As noted, the original file is preserved as 'file.old' where 'file' is whatever filename you specified.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 28 Jul 2006 09:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993436#M100553</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-07-28T09:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Another Inquiry</title>
      <link>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993437#M100554</link>
      <description>Thanks Peter and Sandman!,&lt;BR /&gt;&lt;BR /&gt;This forum is really great!</description>
      <pubDate>Fri, 28 Jul 2006 10:24:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/another-inquiry/m-p/4993437#M100554</guid>
      <dc:creator>Pando</dc:creator>
      <dc:date>2006-07-28T10:24:30Z</dc:date>
    </item>
  </channel>
</rss>

