DAN0207 has asked for the wisdom of the Perl Monks concerning the following question:
I have a text file with the content as follows
SMS,SMS1,20190811,084500,servname,servid,servname1,s1,400,300,300,300, +300,300 SMS,SMSh,20190811,084500,servname,servid,servname1,s1,700,300,300,300, +300,300 SMS,SMSH,20190811,084500,servname,servid,servname1,s1,600,300,300,300, +300,300 SMS,SMSi,20190811,084500,servname,servid,servname1,s1,800,300,300,300, +300,300 SMS,SMSI,20190811,084500,servname,servid,servname1,s1,500,300,300,300, +300,300
I have written the following line of code for case insensitive string comparison
$$blk_ref = 'SMSblk' if $$blk_ref =~ /SMSi/i || $$blk_ref =~ /SMSI/i | +| $$blk_ref =~ /SMSh/i || $$blk_ref =~ /SMSH/i || $$blk_ref =~ /SMS1/ +;
But in the output file, i get the values only for SMSi,SMSh and SMS1.'The values of SMSI and SMSH are not taken.Kindly help to correct my code so that all the values are present in the output file
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Case insensitive string comparison (updated x2)
by AnomalousMonk (Archbishop) on Jun 26, 2020 at 07:42 UTC | |
by Marshall (Canon) on Jun 28, 2020 at 01:40 UTC | |
by AnomalousMonk (Archbishop) on Jun 28, 2020 at 03:16 UTC | |
by Marshall (Canon) on Jun 29, 2020 at 08:23 UTC | |
|
Re: Case insensitive string comparison
by Marshall (Canon) on Jun 27, 2020 at 16:45 UTC | |
by AnomalousMonk (Archbishop) on Jun 28, 2020 at 05:21 UTC | |
by Marshall (Canon) on Jun 29, 2020 at 06:59 UTC | |
by DAN0207 (Acolyte) on Jun 30, 2020 at 12:09 UTC | |
by AnomalousMonk (Archbishop) on Jun 30, 2020 at 17:25 UTC | |
|