An array contains few user IDs. Each user ID is used as a match element in another file. How to match a specific line and array element? And print words at previous line?
The specific line is:
cell ("b05hrn23ud0d3") {array file:
b05bdc00lnz64 b05hrn23ud0d3 b05bgn00lnz00 b05bgn01lnz00
coding:
foreach $a (@arr) { #read each line in array file for (my $count=0; $count <5; $count++) { #iteration for each ID in + array file if(@arr[$count] =~ m/cell\(@arr[$count])){ #match specific line print "aa\n"; #print words at previous line } }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |