<?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: How to split in Perl?? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099717#M90984</link>
    <description>Note that perl is not allways the best tool for simple things like this&lt;BR /&gt;&lt;BR /&gt;$ echo "a&amp;gt;b&amp;gt;c&amp;gt;3" | perl -aF\&amp;gt; -ple'($_=$F[1])=~y/\47"//'&lt;BR /&gt;b&lt;BR /&gt;&lt;BR /&gt;or in a script&lt;BR /&gt;&lt;BR /&gt;(my $f2 = split m/&amp;gt;/, $i, -1) =~ tr/'"//d;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
    <pubDate>Wed, 26 Mar 2008 06:21:42 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2008-03-26T06:21:42Z</dc:date>
    <item>
      <title>How to split in Perl??</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099715#M90982</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I want convert below shell script statement into perl using split// or tr//. &lt;BR /&gt;&lt;BR /&gt;   echo "$i"| cut -d "&amp;gt;" -f2 | tr -d "',"&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Rajesh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Mar 2008 04:52:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099715#M90982</guid>
      <dc:creator>Rajesh SB</dc:creator>
      <dc:date>2008-03-26T04:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to split in Perl??</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099716#M90983</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Your $i obvious has the following&lt;BR /&gt;characteristics:&lt;BR /&gt;&lt;BR /&gt;a) The delimiter is character (&amp;gt;)&lt;BR /&gt;&lt;BR /&gt;b) You want the second field&lt;BR /&gt;&lt;BR /&gt;c) And finally, from the second field&lt;BR /&gt;remove all instances of characters&lt;BR /&gt;comma (,) and single-quote (').&lt;BR /&gt;&lt;BR /&gt;Here is a little Perl script to&lt;BR /&gt;demonstrate what you want:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;my $LINE = "baba &amp;gt; second row contains comma (,) and quote (') &amp;gt;third something &amp;gt;fourth and so on&amp;gt;fifth";&lt;BR /&gt;&lt;BR /&gt;my @ARR = split(/&amp;gt;/, $LINE);&lt;BR /&gt;&lt;BR /&gt;print "BEFORE @ARR[1]\n";&lt;BR /&gt;&lt;BR /&gt;@ARR[1] =~ s/'//g;&lt;BR /&gt;@ARR[1] =~ s/,//g;&lt;BR /&gt;&lt;BR /&gt;print "AFTER  @ARR[1]\n";&lt;BR /&gt;exit;&lt;BR /&gt;&lt;BR /&gt;When you run it:&lt;BR /&gt;&lt;BR /&gt;BEFORE  second row contains comma (,) and quote (') &lt;BR /&gt;AFTER   second row contains comma () and quote () &lt;BR /&gt;&lt;BR /&gt;Perl is very powerful and I am sure there&lt;BR /&gt;will be other elegant solutions in this&lt;BR /&gt;Forum.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Wed, 26 Mar 2008 05:41:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099716#M90983</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2008-03-26T05:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to split in Perl??</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099717#M90984</link>
      <description>Note that perl is not allways the best tool for simple things like this&lt;BR /&gt;&lt;BR /&gt;$ echo "a&amp;gt;b&amp;gt;c&amp;gt;3" | perl -aF\&amp;gt; -ple'($_=$F[1])=~y/\47"//'&lt;BR /&gt;b&lt;BR /&gt;&lt;BR /&gt;or in a script&lt;BR /&gt;&lt;BR /&gt;(my $f2 = split m/&amp;gt;/, $i, -1) =~ tr/'"//d;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 26 Mar 2008 06:21:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099717#M90984</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2008-03-26T06:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to split in Perl??</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099718#M90985</link>
      <description>Hello Guys,&lt;BR /&gt;&lt;BR /&gt;I used following commands to extract the interested values, instead of using array.&lt;BR /&gt;&lt;BR /&gt;for($i=0;$i&amp;lt;=$#fstab_array;$i++)&lt;BR /&gt;{&lt;BR /&gt;    ($fstype0, $fstype) =  split(/&amp;gt;/, "$fstab_array[$i]");&lt;BR /&gt; $fstype =~ tr/',//d;&lt;BR /&gt;        $i += 1;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Rajesh</description>
      <pubDate>Mon, 14 Apr 2008 01:28:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-split-in-perl/m-p/5099718#M90985</guid>
      <dc:creator>Rajesh SB</dc:creator>
      <dc:date>2008-04-14T01:28:51Z</dc:date>
    </item>
  </channel>
</rss>

