<?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: get a string in a line in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577664#M229263</link>
    <description>It is easy that. You have to search the line with solve string and change into 'solve' that is all. Do it with awk as,&lt;BR /&gt;&lt;BR /&gt;echo "i want to solve this problem" | awk '/solve/ { print "solve";}'&lt;BR /&gt;&lt;BR /&gt;hth.</description>
    <pubDate>Thu, 07 Jul 2005 05:36:21 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-07-07T05:36:21Z</dc:date>
    <item>
      <title>get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577657#M229256</link>
      <description>hi, anybody help me&lt;BR /&gt;&lt;BR /&gt;how to get a string in a line hp ux?&lt;BR /&gt;&lt;BR /&gt;'i want to solve this problem' and i want to get 'solve' but how?</description>
      <pubDate>Thu, 07 Jul 2005 03:48:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577657#M229256</guid>
      <dc:creator>idi</dc:creator>
      <dc:date>2005-07-07T03:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577658#M229257</link>
      <description>could you post an example ?</description>
      <pubDate>Thu, 07 Jul 2005 03:51:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577658#M229257</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2005-07-07T03:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577659#M229258</link>
      <description>You can use awk, sed for getting string in a line. grep can used to search it. post example input and output you want.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Thu, 07 Jul 2005 04:05:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577659#M229258</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-07-07T04:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577660#M229259</link>
      <description>Hi,&lt;BR /&gt;if you simply want to get a line in a file, use a grep command, it's a simplier way!!&lt;BR /&gt;&lt;BR /&gt;i.e.&lt;BR /&gt;&lt;BR /&gt;grep test file&lt;BR /&gt;&lt;BR /&gt;(if you want to search a string with a test word)&lt;BR /&gt;&lt;BR /&gt;enjoy&lt;BR /&gt;&lt;BR /&gt;Giacomo&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jul 2005 04:19:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577660#M229259</guid>
      <dc:creator>Giacomo TOTTI</dc:creator>
      <dc:date>2005-07-07T04:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577661#M229260</link>
      <description>if you know the position of the string use:&lt;BR /&gt;awk '{ print $4 }'</description>
      <pubDate>Thu, 07 Jul 2005 04:19:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577661#M229260</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-07-07T04:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577662#M229261</link>
      <description>LINE IS: 'i want to solve this problem' &lt;BR /&gt;and STRING IS: 'solve' &lt;BR /&gt;so how can i get these string? &lt;BR /&gt;&lt;BR /&gt;note: i just want to get the string 'solve'&lt;BR /&gt;i dont want to get line (grep command is not suitable for this question)</description>
      <pubDate>Thu, 07 Jul 2005 05:19:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577662#M229261</guid>
      <dc:creator>idi</dc:creator>
      <dc:date>2005-07-07T05:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577663#M229262</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;echo "i want to solve this problem" | sed '/solve/!d;s/^.*solve.*/solve/'&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;echo "i want to solve this problem" | grep 'solve' | sed '/solve/!d;s/^.*solve.*/solve/'&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Thu, 07 Jul 2005 05:35:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577663#M229262</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-07-07T05:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577664#M229263</link>
      <description>It is easy that. You have to search the line with solve string and change into 'solve' that is all. Do it with awk as,&lt;BR /&gt;&lt;BR /&gt;echo "i want to solve this problem" | awk '/solve/ { print "solve";}'&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Thu, 07 Jul 2005 05:36:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577664#M229263</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-07-07T05:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577665#M229264</link>
      <description>Hi,&lt;BR /&gt;If you want to search for strings in plain text files you can use "grep -q".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  -q                  (Quiet) Do not write anything to the standard&lt;BR /&gt;                      output, regardless of matching lines.  Exit&lt;BR /&gt;                      with zero status upon finding the first&lt;BR /&gt;                      matching line.  Overrides any options that&lt;BR /&gt;                      would produce output.&lt;BR /&gt;&lt;BR /&gt;Then you can use an "if" condition to print out anything you want depending on hit/non hit.</description>
      <pubDate>Thu, 07 Jul 2005 05:47:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577665#M229264</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2005-07-07T05:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577666#M229265</link>
      <description>OK,&lt;BR /&gt;if the word "solve" is always on the fourth position, than:&lt;BR /&gt;&lt;BR /&gt;grep solve file| awk '{print $4}'&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Giacomo</description>
      <pubDate>Thu, 07 Jul 2005 05:54:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577666#M229265</guid>
      <dc:creator>Giacomo TOTTI</dc:creator>
      <dc:date>2005-07-07T05:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577667#M229266</link>
      <description>Idi,&lt;BR /&gt;echo "i want to solve this problem" | awk '{ print $4 }'</description>
      <pubDate>Thu, 07 Jul 2005 06:27:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577667#M229266</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-07-07T06:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577668#M229267</link>
      <description>Thank you so much all you, But actually my real problem is, I have a text which i gave 'attachment'&lt;BR /&gt;&lt;BR /&gt;and firstly i want to find 'May 13 2003' string in this text and after i want to clear the lines which, dates are before 'May 13 2003'&lt;BR /&gt;&lt;BR /&gt;Thank you again so much&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jul 2005 06:27:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577668#M229267</guid>
      <dc:creator>idi</dc:creator>
      <dc:date>2005-07-07T06:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577669#M229268</link>
      <description>Hi,&lt;BR /&gt;try this slightly reused awk statement:&lt;BR /&gt;&lt;BR /&gt;#  awk '/May 13/,/\$/' orgfile &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;and then&lt;BR /&gt;# diff orgfile newfile&lt;BR /&gt;to check if it is ok.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Thu, 07 Jul 2005 06:49:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577669#M229268</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-07-07T06:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577670#M229269</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt; ## CODE ###&lt;BR /&gt; FILENAME=testfile&lt;BR /&gt; LINE=$(grep -n 'May 13.*2003' $FILENAME | cut -d':' -f1)&lt;BR /&gt; tail -f +${LINE} $FILENAME&lt;BR /&gt; ##&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jul 2005 06:52:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577670#M229269</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-07-07T06:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577671#M229270</link>
      <description>This isn't going to be an easy one-liner. You need to pull the time stamps, then compare. First off, the lines do not all have the same number of columns so try the following to parse the timestamps;&lt;BR /&gt;&lt;BR /&gt;awk '{ print $(NF-3),$(NF-2),$(NF-1),$NF }' file&lt;BR /&gt;&lt;BR /&gt;Once you have the timestamps you will need to do some coding where you compare the year, then month, then day.&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Thu, 07 Jul 2005 07:55:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577671#M229270</guid>
      <dc:creator>David Child_1</dc:creator>
      <dc:date>2005-07-07T07:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: get a string in a line</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577672#M229271</link>
      <description>Use grep -w -c&lt;BR /&gt;&lt;BR /&gt;lt09:/home/merijn 102 &amp;gt; grep -c -w merijn /etc/passwd&lt;BR /&gt;1&lt;BR /&gt;lt09:/home/merijn 103 &amp;gt; grep -c -w merlijn /etc/passwd&lt;BR /&gt;0&lt;BR /&gt;lt09:/home/merijn 104 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Since you want returned something you know, it doesn't matter if you get that word or "1"&lt;BR /&gt;&lt;BR /&gt;If you *do* mind, try this:&lt;BR /&gt;&lt;BR /&gt;sh-3.00$ var=merijn&lt;BR /&gt;sh-3.00$ grep -q -w $var /etc/passwd &amp;amp;&amp;amp; echo $var&lt;BR /&gt;merijn&lt;BR /&gt;sh-3.00$ var=merlijn&lt;BR /&gt;sh-3.00$ grep -q -w $var /etc/passwd &amp;amp;&amp;amp; echo $var&lt;BR /&gt;sh-3.00$&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 07 Jul 2005 09:54:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/get-a-string-in-a-line/m-p/3577672#M229271</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-07-07T09:54:07Z</dc:date>
    </item>
  </channel>
</rss>

