<?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: Print from matched string on.... in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089522#M93175</link>
    <description>Try this:&lt;BR /&gt;&lt;BR /&gt;awk '/certain string/,0' file.txt&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Thu, 24 Jan 2008 14:13:48 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2008-01-24T14:13:48Z</dc:date>
    <item>
      <title>Print from matched string on....</title>
      <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089519#M93172</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How can I print or get the output from a certain string on...like everything after that string printed out to the screen?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sally</description>
      <pubDate>Thu, 24 Jan 2008 13:56:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089519#M93172</guid>
      <dc:creator>dev44</dc:creator>
      <dc:date>2008-01-24T13:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Print from matched string on....</title>
      <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089520#M93173</link>
      <description>Hi Sally:&lt;BR /&gt;&lt;BR /&gt;# cat stuff&lt;BR /&gt;this is a file&lt;BR /&gt;of stuff&lt;BR /&gt;which I want to&lt;BR /&gt;dump from here&lt;BR /&gt;to the end.&lt;BR /&gt;Hence, here it is...&lt;BR /&gt;from there to the end.&lt;BR /&gt;&lt;BR /&gt;# sed -ne '/here/,$p' stuff&lt;BR /&gt;dump from here&lt;BR /&gt;to the end.&lt;BR /&gt;Hence, here it is...&lt;BR /&gt;from there to the end.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jan 2008 14:07:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089520#M93173</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-24T14:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Print from matched string on....</title>
      <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089521#M93174</link>
      <description>Sally,&lt;BR /&gt;&lt;BR /&gt;For questions like this I always turn to "Handy One-Liners for Sed" (attached) which I found here on the Forums years ago.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 24 Jan 2008 14:11:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089521#M93174</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-01-24T14:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Print from matched string on....</title>
      <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089522#M93175</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;awk '/certain string/,0' file.txt&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jan 2008 14:13:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089522#M93175</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-01-24T14:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Print from matched string on....</title>
      <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089523#M93176</link>
      <description>Thanks guys!</description>
      <pubDate>Thu, 24 Jan 2008 14:16:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089523#M93176</guid>
      <dc:creator>dev44</dc:creator>
      <dc:date>2008-01-24T14:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Print from matched string on....</title>
      <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089524#M93177</link>
      <description>Hi Sally:&lt;BR /&gt;&lt;BR /&gt;If you mean literally "everything AFTER that string" but not anything that preceeds it on the same line, I'd do it thusly:&lt;BR /&gt;&lt;BR /&gt;# perl -nle 'if ($n) {print} elsif (m/(here.*)/) {print $1;$n++}'&lt;BR /&gt;&lt;BR /&gt;It this example, the string to match is "here".  As written it could be a part of the string "where".  Thus, if you wanted only the isolated word "here" (at a boundary) , change this to:&lt;BR /&gt;&lt;BR /&gt;# perl -nle 'if ($n) {print} elsif (m/(\bhere\b.*)/) {print $1;$n++}'&lt;BR /&gt;&lt;BR /&gt;Now use this variation and compare the difference of the two:&lt;BR /&gt;&lt;BR /&gt;# cat stuff&lt;BR /&gt;this is a file&lt;BR /&gt;of stuff&lt;BR /&gt;where I want to&lt;BR /&gt;dump from here to&lt;BR /&gt;the end.&lt;BR /&gt;Hence, here it is...&lt;BR /&gt;from there to the end.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 24 Jan 2008 14:23:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089524#M93177</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-24T14:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Print from matched string on....</title>
      <link>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089525#M93178</link>
      <description>This topic is closed, problem solved. Excellent!&lt;BR /&gt;But I had an extra thought...&lt;BR /&gt;&lt;BR /&gt;'Normally' (is there such thing?) the awk range is used as: /start/,/end/&lt;BR /&gt;&lt;BR /&gt;In my example I used a hardcoded 0 as end test, so the end match is never true (near). It ends when the data ends.&lt;BR /&gt;&lt;BR /&gt;Sometimes I want to see a few lines after a match. I just realized that using a similar technique one could use:&lt;BR /&gt;&lt;BR /&gt;awk '/error/,!++x%5' file.log&lt;BR /&gt;&lt;BR /&gt;This is only a quick and dirty solution.&lt;BR /&gt;One would probably want a seperator between matching zones.&lt;BR /&gt;And what to do on re-match while in the print zone?&lt;BR /&gt;If you solve all that, then it quickly becomes a full blown script.&lt;BR /&gt;Cute?&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jan 2008 14:53:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/print-from-matched-string-on/m-p/5089525#M93178</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-01-24T14:53:20Z</dc:date>
    </item>
  </channel>
</rss>

