<?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: Script/awk/sed question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781352#M722522</link>
    <description>Duke,&lt;BR /&gt;&lt;BR /&gt;This should work as well.&lt;BR /&gt;&lt;BR /&gt;# sed 's/^.*Phone/Phone/' text_file | awk '{print $1 " " $2}'&lt;BR /&gt;&lt;BR /&gt;Hai</description>
    <pubDate>Wed, 07 Aug 2002 12:13:31 GMT</pubDate>
    <dc:creator>Hai Nguyen_1</dc:creator>
    <dc:date>2002-08-07T12:13:31Z</dc:date>
    <item>
      <title>Script/awk/sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781349#M722519</link>
      <description>I am trying to search a text file for a particular string and print that string plus the next n number of characters following that string. For example:&lt;BR /&gt;&lt;BR /&gt;Contents of text file:&lt;BR /&gt;1234 qwer Phone 123-123-1234&lt;BR /&gt;76 wejyf Phone 567-325-8765&lt;BR /&gt;Phone 983-876-3241 3 deddfgh&lt;BR /&gt;q Phone 000-335-6593 ddi555&lt;BR /&gt;&lt;BR /&gt;Want output to be:&lt;BR /&gt;Phone 123-123-1234&lt;BR /&gt;Phone 567-325-8765&lt;BR /&gt;Phone 983-876-3241&lt;BR /&gt;Phone 000-335-6593 &lt;BR /&gt;&lt;BR /&gt;What would be the best way to accomplish this?  Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Duke&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Aug 2002 11:50:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781349#M722519</guid>
      <dc:creator>Duke Nguyen</dc:creator>
      <dc:date>2002-08-07T11:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Script/awk/sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781350#M722520</link>
      <description>Assume Phone is your pattern.&lt;BR /&gt;Assume the data is in file yourData.&lt;BR /&gt;Assume you need 18 columns (characters) at the end (Phone xxx-xxx-xxxx).&lt;BR /&gt;&lt;BR /&gt;grep Phone yourData | sed -e "s/.*Phone/Phone/" | cut -c1-18&lt;BR /&gt;&lt;BR /&gt;grep finds the pattern.&lt;BR /&gt;sed deletes characters in front of the pattern.&lt;BR /&gt;cut keeps the number of characters you want.&lt;BR /&gt;&lt;BR /&gt;Tom</description>
      <pubDate>Wed, 07 Aug 2002 11:59:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781350#M722520</guid>
      <dc:creator>Tom Maloy</dc:creator>
      <dc:date>2002-08-07T11:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script/awk/sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781351#M722521</link>
      <description>perl -pe 's/^.*\b(Phone\s*[-\d]+)\b.*$/$1/' phone-file</description>
      <pubDate>Wed, 07 Aug 2002 12:06:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781351#M722521</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-08-07T12:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script/awk/sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781352#M722522</link>
      <description>Duke,&lt;BR /&gt;&lt;BR /&gt;This should work as well.&lt;BR /&gt;&lt;BR /&gt;# sed 's/^.*Phone/Phone/' text_file | awk '{print $1 " " $2}'&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Wed, 07 Aug 2002 12:13:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781352#M722522</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2002-08-07T12:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script/awk/sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781353#M722523</link>
      <description>...or even:&lt;BR /&gt;&lt;BR /&gt;sed 's/.*\(Phone [^ ]*\).*/\1/' filename&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 07 Aug 2002 13:02:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781353#M722523</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-08-07T13:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script/awk/sed question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781354#M722524</link>
      <description>Thanks everyone!</description>
      <pubDate>Wed, 07 Aug 2002 14:03:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-awk-sed-question/m-p/2781354#M722524</guid>
      <dc:creator>Duke Nguyen</dc:creator>
      <dc:date>2002-08-07T14:03:58Z</dc:date>
    </item>
  </channel>
</rss>

