![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Split Command in Perl | rochitsharma | UNIX for Advanced & Expert Users | 9 | 03-09-2008 03:56 AM |
| split to array in perl | jaganadh | Shell Programming and Scripting | 3 | 07-06-2007 06:29 AM |
| Perl Split Command usage | maheshsri | Shell Programming and Scripting | 2 | 12-17-2006 08:30 AM |
| multiple pattern split in perl | umen | Shell Programming and Scripting | 3 | 08-01-2006 03:43 AM |
| perl split function | new2ss | Shell Programming and Scripting | 5 | 06-08-2006 11:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
split question perl
I am interested in 2 and 36th fields in this input file. I was wondering if there was a more efficeint way to do this.
($pt1,$bkup_name,$pt3,$pt4,$pt5,$pt6,$pt7,$pt8,$pt9, $pt10,$pt11,$pt12,$pt13,$pt14,$pt15,$pt16,$pt17, $pt18,$pt19,$pt20,$pt21,$pt22,$pt23,$pt24,$pt25, $pt26,$pt27,$pt28,$pt29,$pt30,$pt31,$pt32,$pt33, $pt34,$pt35,$tcpname,$pt37)=split(/,/,$tmpArr[$x]); |
|
||||
|
Just thought I'd revisit this cause I discovered that you can get to a specific field by using a splice. If I want the 2nd and 36th field you can do
($field2,$field36) = (split /,/, $tmpArr[$x]) [2,36]; Hope this is helpful to others. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|