<?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 Awk in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330581#M13183</link>
    <description>Hi i am trying to get output as&lt;BR /&gt;temp&lt;BR /&gt;123&lt;BR /&gt;lib&lt;BR /&gt;resd&lt;BR /&gt;com&lt;BR /&gt;hp&lt;BR /&gt;res&lt;BR /&gt;email&lt;BR /&gt;html.txt&lt;BR /&gt;&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt| awk '{print substr($0,1)}'&lt;BR /&gt;&lt;BR /&gt;I did try a lot with substr, i tried cut and split too.&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt|cut -d / -f1&lt;BR /&gt;&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt|awk '{split('$0',a,"/"); print a[1]}'&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Tue, 13 Jul 2004 17:10:11 GMT</pubDate>
    <dc:creator>Vanquish</dc:creator>
    <dc:date>2004-07-13T17:10:11Z</dc:date>
    <item>
      <title>Awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330581#M13183</link>
      <description>Hi i am trying to get output as&lt;BR /&gt;temp&lt;BR /&gt;123&lt;BR /&gt;lib&lt;BR /&gt;resd&lt;BR /&gt;com&lt;BR /&gt;hp&lt;BR /&gt;res&lt;BR /&gt;email&lt;BR /&gt;html.txt&lt;BR /&gt;&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt| awk '{print substr($0,1)}'&lt;BR /&gt;&lt;BR /&gt;I did try a lot with substr, i tried cut and split too.&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt|cut -d / -f1&lt;BR /&gt;&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt|awk '{split('$0',a,"/"); print a[1]}'&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 13 Jul 2004 17:10:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330581#M13183</guid>
      <dc:creator>Vanquish</dc:creator>
      <dc:date>2004-07-13T17:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330582#M13184</link>
      <description>awk -F"/" {print $1,"\n",$2,"\n", ...}'&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Jul 2004 17:17:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330582#M13184</guid>
      <dc:creator>K.C. Chan</dc:creator>
      <dc:date>2004-07-13T17:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330583#M13185</link>
      <description>So basically you want to replace all /'s with a line feed.  'tr' is the tool for you:&lt;BR /&gt;&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt | tr '/' '\n'&lt;BR /&gt;&lt;BR /&gt;This will put each part of the path on a separate line.&lt;BR /&gt;&lt;BR /&gt;That being said, what's your goal of doing this?  If you want to just get the file-name off the end, then just use the 'basename' command.</description>
      <pubDate>Tue, 13 Jul 2004 18:12:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330583#M13185</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-07-13T18:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330584#M13186</link>
      <description>hai,&lt;BR /&gt;&lt;BR /&gt; To do this, use&lt;BR /&gt;&lt;BR /&gt; 1. printf "$(echo temp/123/lib/resd/com/hp/res/app/email/html.txt | sed -e 's/\//\\n/g')"&lt;BR /&gt;&lt;BR /&gt; 2. echo temp/123/lib/resd/com/hp/res/app/email/html.txt | sed -e 's/\//\&lt;BR /&gt;/g'&lt;BR /&gt;&lt;BR /&gt; 3. echo temp/123/lib/resd/com/hp/res/app/email/html.txt| awk -F '/' '{&lt;BR /&gt;for ( i=1; i&amp;lt;=NF; i++) print $i }'&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Muthukumar.</description>
      <pubDate>Tue, 13 Jul 2004 23:36:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330584#M13186</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-07-13T23:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330585#M13187</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;like K.C. Chan but with all fields:&lt;BR /&gt;&lt;BR /&gt;echo temp/123/lib/resd/com/hp/res/app/email/html.txt | awk -F'/' '{for (i=1;i&amp;lt;=NF;i++) print $i}'&lt;BR /&gt;&lt;BR /&gt;Frank.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Jul 2004 01:39:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk/m-p/3330585#M13187</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-07-14T01:39:39Z</dc:date>
    </item>
  </channel>
</rss>

