For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > reg exp using \G









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author reg exp using \G
DBSMITH@OhioHealth.com

2005-08-02, 5:00 pm

All,

I think I am on the right track as far as what assertion to use. I need to
print from one string to another using .. with \G
My goal is to capture from allsets down.

thank you



Here is my code:

#!/usr/bin/perl
use strict;
use warnings;
$ENV{PATH} = qq(/opt/SUNWsamfs/sbin:/usr/bin);
open (ARC, "archiver -lv |") or die $!;

foreach (<ARC> )
{
##-- Tape --##
if (/allsets/ .. /fs_clinical.1/)
{
print $_;
my $tape =$1;
} else {
/ \G 'heartlab.1'/
}
}
close (ARC);

__END_CODE__
__BEGIN_DATA__


Reading '/etc/opt/SUNWsamfs/archiver.cmd'.
1: #wait
2: #
3: logfile = /asmcat/logs/archiver.log
4: #
5: archmax = sg 2G
6: archmax = sf 2G
7: #
8: drives = stk800 6
9: drives = stk900 4
10: #
11: interval = 15m
12: #
13: fs = original1
14: 1 50y
15:
16: back backup
17: 1 -norelease 1m
18: 2 -norelease 1m
19:
20: fs_original . -stage a
21: 1 -norelease 12m
22: 2 -norelease 12m
23: 3 -norelease 12m
24:
25: fs = clinical1
26: 1 50y
27:
28: back backup
29: 1 -norelease 1m
30: 2 -norelease 1m
31:
32: fs_clinical . -stage a
33: 1 -norelease 12m
34: 2 -norelease 12m
35: 3 -norelease 12m
36:
37: #fs = fuji_data
38: #1 50y
39:
40: fs = lanv1
41: 1 50y
42:
43: back backup
44: 1 -norelease 1m
45: 2 -norelease 1m
46:
47: #fs_fuji_data . -stage a
48: #1 -norelease 12m
49: #2 -norelease 12m
50: #3 -norelease 12m
51:
52: fs_lanv1 .
53: 1 -norelease 5m
54: 2 -norelease 5m
55: 3 -norelease 5m
56:
57: fs = heartlab
58: 1 50y
59:
60: back backup
61: 1 -norelease 1m
62: 2 -norelease 1m
63:
64: fs_heartlab .
65: 1 -norelease 12m
66: 2 -norelease 12m
67:
68: fs = lanv
69: 1 50y
70:
71: back backup
72: 1 -norelease 1m
73: 2 -norelease 1m
74:
75: fs_lanvision .
76: 1 -norelease 5m
77: 2 -norelease 5m
78: 3 -norelease 5m
79:
80: fs = darch
81: 1 50y
82: no_archive .
83:
84: params
85: fs_original.1 -sort path -disk_archive disk0
86: fs_original.2 -sort path
87: fs_original.3 -sort path
88:
89: fs_clinical.1 -sort path -disk_archive disk1
90: fs_clinical.2 -sort path
91: fs_clinical.3 -sort path
92:
93: #fs_fuji_data.1 -sort path -disk_archive disk2
94: #fs_fuji_data.2 -sort path
95: #fs_fuji_data.3 -sort path
96:
97: fs_lanv1.1 -sort path -disk_archive disk2
98: fs_lanv1.2 -sort path
99: fs_lanv1.3 -sort path
100:
101: fs_heartlab.1 -sort path
102: fs_heartlab.2 -sort path
103:
104: fs_lanvision.1 -sort path -disk_archive disk3
105: fs_lanvision.2 -sort path
106: fs_lanvision.3 -sort path
107: endparams
108: #
109: #
110:
111: vsns
112: #Backups
113: back.1 sf STK00[0-4]
114: back.2 sf STK00[5-9]
115:
116: # Metadata
117: original1.1 sf STK00[0-4]
118: clinical1.1 sf STK00[0-4]
119: #fuji_data.1 sf STK00[0-4]
120: lanv1.1 sf STK00[0-4]
121: heartlab.1 sf STK00[0-4]
122: lanv.1 sf STK00[0-4]
123: darch.1 sf STK00[0-4]
124:
125: # sg = 9840 media
126: # sf = 9940 media
127:
128: ## Fuji Tape Copies
129: fs_original.2 sg F01[0-9][0-9][0-9] #F01000-F01999
130: fs_original.3 sf F02[0-9][0-9][0-9] #F02000-F02999
131: fs_clinical.2 sg F01[0-9][0-9][0-9] #F01000-F01999
132: fs_clinical.3 sf F02[0-9][0-9][0-9] #F02000-F02999
133: #fs_fuji_data.2 sg F01[0-9][0-9][0-9] #F01000-F01999
134: #fs_fuji_data.3 sf F02[0-9][0-9][0-9] #F02000-F02999
135:
136: ## Heartlab Tape Copies
137: ## Tapes H0105[3-9] were physically never put in SILO, somehow
misplaced. --- 05/27/05 DBS
138: ## H02028 is damaged and has been rearchived --- 07/21/05 DBS
139:
140: fs_heartlab.1 sg H01[0-9][0-9][0-9] #H01000-H01999
141: fs_heartlab.2 sf H02[0-9][0-9][0-9] #H02000-H02999
142:
143: ## LANVision Tape Copies
144: fs_lanvision.2 sg L01[0-9][0-9][0-9] #L01000-L01999
145: fs_lanvision.3 sf L02[0-9][0-9][0-9] #L02000-L02999
146: fs_lanv1.2 sg L01[0-9][0-9][0-9] #L01000-L01999
147: fs_lanv1.3 sf L02[0-9][0-9][0-9] #L02000-L02999
148: endvsns
Notify file: /opt/SUNWsamfs/sbin/archiver.sh

Archive media:
media:sg bufsize: 4 archmax: 2.0G Volume overflow not selected
media:sf bufsize: 4 archmax: 2.0G Volume overflow not selected

Archive libraries:
Device:stk800 drives_available:7 archive_drives:6
Catalog:
sg.STKTAP capacity: 39.1G space: 39.1G -il-o-b-----
sg.F01000 capacity: 39.1G space: 38.2G -il-o-b-----
reserved: fs_clinical.2//
sg.F01001 capacity: 39.1G space: 38.6G -il-o-b-----
reserved: fs_original.2//
sg.F01002 capacity: 39.1G space: 39.1G -il-o-b-----
reserved: fs_fuji_data.2//
sg.F01003 capacity: 39.1G space: 0 -il-o-b----f
sg.F01004 capacity: 39.1G space: 0 -il-o-b----f
sg.F01005 capacity: 39.1G space: 0 -il-o-b-----
sg.H01000 capacity: 39.1G space: 0 -il-o-b----f
sg.H01001 capacity: 39.1G space: 0 -il-o-b----f
sg.H01002 capacity: 39.1G space: 0 -il-o-b----f
sg.H01003 capacity: 39.1G space: 0 -il-o-b----f
sg.H01004 capacity: 39.1G space: 0 -il-o-b-----
sg.H01005 capacity: 39.1G space: 0 -il-o-b-----
sg.F01006 capacity: 39.1G space: 0 -il-o-b----f
sg.F01007 capacity: 39.1G space: 0 -il-o-b----f
sg.F01008 capacity: 39.1G space: 0 -il-o-b----f
sg.F01009 capacity: 39.1G space: 0 -il-o-b----f
sg.F01010 capacity: 39.1G space: 0 -il-o-b----f
sg.F01011 capacity: 39.1G space: 0 -il-o-b----f
sg.F01012 capacity: 39.1G space: 0 -il-o-b----f
sg.F01013 capacity: 39.1G space: 0 -il-o-b-----
sg.F01014 capacity: 39.1G space: 0 -il-o-b----f
sg.F01015 capacity: 39.1G space: 0 -il-o-b----f
sg.F01016 capacity: 39.1G space: 0 -il-o-b-----
sg.F01017 capacity: 39.1G space: 0 -il-o-b----f
sg.F01018 capacity: 39.1G space: 0 -il-o-b-----
sg.F01019 capacity: 39.1G space: 0 -il-o-b----f
sg.F01020 capacity: 39.1G space: 0 -il-o-b----f
sg.F01021 capacity: 39.1G space: 0 -il-o-b-----
sg.F01022 capacity: 39.1G space: 0 -il-o-b-----
sg.F01023 capacity: 39.1G space: 0 -il-o-b-----
sg.F01024 capacity: 39.1G space: 0 -il-o-b-----
sg.F01025 capacity: 39.1G space: 0 -il-o-b----f
sg.F01026 capacity: 39.1G space: 0 -il-o-b-----
sg.F01027 capacity: 39.1G space: 0 -il-o-b-----
sg.F01028 capacity: 39.1G space: 0 -il-o-b----f
sg.F01029 capacity: 39.1G space: 0 -il-o-b-----
sg.F01030 capacity: 39.1G space: 0 -il-o-b----f
sg.F01031 capacity: 39.1G space: 0 -il-o-b----f
sg.F01032 capacity: 39.1G space: 0 -il-o-b----f
sg.F01033 capacity: 39.1G space: 0 -il-o-b----f
sg.F01034 capacity: 39.1G space: 0 -il-o-b----f
sg.F01035 capacity: 39.1G space: 0 -il-o-b----f
sg.H01006 capacity: 39.1G space: 0 -il-o-b-----
sg.H01007 capacity: 39.1G space: 0 -il-o-b----f
sg.H01008 capacity: 39.1G space: 0 -il-o-b----f
sg.H01009 capacity: 39.1G space: 0 -il-o-b----f
sg.H01010 capacity: 39.1G space: 0 -il-o-b----f
sg.H01011 capacity: 39.1G space: 0 -il-o-b----f
sg.H01012 capacity: 39.1G space: 0 -il-o-b----f
sg.H01013 capacity: 39.1G space: 0 -il-o-b----f
sg.H01014 capacity: 39.1G space: 0 -il-o-b----f
sg.H01015 capacity: 39.1G space: 0 -il-o-b-----
sg.H01016 capacity: 39.1G space: 0 -il-o-b----f
sg.H01017 capacity: 39.1G space: 0 -il-o-b-----
sg.H01018 capacity: 39.1G space: 0 -il-o-b----f
sg.F01036 capacity: 39.1G space: 0 -il-o-b-----
sg.H01019 capacity: 39.1G space: 0 -il-o-b----f
sg.H01020 capacity: 39.1G space: 0 -il-o-b----f
sg.H01021 capacity: 39.1G space: 0 -il-o-b----f
sg.H01022 capacity: 39.1G space: 0 -il-o-b----f
sg.H01023 capacity: 39.1G space: 0 -il-o-b-----
sg.H01024 capacity: 39.1G space: 0 -il-o-b----f
sg.H01025 capacity: 39.1G space: 0 -il-o-b----f
sg.H01026 capacity: 39.1G space: 0 -il-o-b-----
sg.H01027 capacity: 39.1G space: 0 -il-o-b-----
sg.H01028 capacity: 39.1G space: 0 -il-o-b-----
sg.H01029 capacity: 39.1G space: 0 -il-o-b----f
sg.H01030 capacity: 39.1G space: 0 -il-o-b----f
sg.H01031 capacity: 39.1G space: 0 -il-o-b----f
sg.H01032 capacity: 39.1G space: 0 -il-o-b----f
sg.H01033 capacity: 39.1G space: 0 -il-o-b-----
sg.H01034 capacity: 39.1G space: 0 -il-o-b----f
sg.H01035 capacity: 39.1G space: 0 -il-o-b----f
sg.H01036 capacity: 39.1G space: 0 -il-o-b-----
sg.H01037 capacity: 39.1G space: 0 -il-o-b----f
sg.H01038 capacity: 39.1G space: 0 -il-o-b----f
sg.H01039 capacity: 39.1G space: 0 -il-o-b----f
sg.H01040 capacity: 39.1G space: 0 -il-o-b-----
sg.H01041 capacity: 39.1G space: 0 -il-o-b-----
sg.H01042 capacity: 39.1G space: 0 -il-o-b-----
sg.H01043 capacity: 39.1G space: 0 -il-o-b----f
sg.H01044 capacity: 39.1G space: 0 -il-o-b----f
sg.H01045 capacity: 39.1G space: 0 -il-o-b-----
sg.H01046 capacity: 39.1G space: 0 -il-o-b----f
sg.H01047 capacity: 39.1G space: 0 -il-o-b----f
sg.H01048 capacity: 39.1G space: 0 -il-o-b----f
sg.H01049 capacity: 39.1G space: 0 -il-o-b----f
sg.H01052 capacity: 39.1G space: 0 -il-o-b----f
sg.H01060 capacity: 39.1G space: 0 -il-o-b----f
sg.H01077 capacity: 39.1G space: 0 -il-o-b----f
sg.F01037 capacity: 39.1G space: 0 -il-o-b----f
sg.F01038 capacity: 39.1G space: 0 -il-o-b----f
sg.F01039 capacity: 39.1G space: 0 -il-o-b----f
sg.F01040 capacity: 39.1G space: 0 -il-o-b----f
sg.F01041 capacity: 39.1G space: 0 -il-o-b----f
sg.F01042 capacity: 39.1G space: 0 -il-o-b----f
sg.F01043 capacity: 39.1G space: 0 -il-o-b----f
sg.F01044 capacity: 39.1G space: 0 -il-o-b----f
sg.F01045 capacity: 39.1G space: 0 -il-o-b----f
sg.F01046 capacity: 39.1G space: 0 -il-o-b----f
sg.F01047 capacity: 39.1G space: 0 -il-o-b----f
sg.F01048 capacity: 39.1G space: 0 -il-o-b----f
sg.F01049 capacity: 39.1G space: 0 -il-o-b----f
sg.F01050 capacity: 39.1G space: 0 -il-o-b----f
sg.F01051 capacity: 39.1G space: 0 -il-o-b----f
sg.F01052 capacity: 39.1G space: 0 -il-o-b----f
sg.F01053 capacity: 39.1G space: 0 -il-o-b----f
sg.F01054 capacity: 39.1G space: 0 -il-o-b----f
sg.F01055 capacity: 39.1G space: 0 -il-o-b----f
sg.F01056 capacity: 39.1G space: 0 -il-o-b----f
sg.F01057 capacity: 39.1G space: 0 -il-o-b----f
sg.F01058 capacity: 39.1G space: 0 -il-o-b-----
sg.F01059 capacity: 39.1G space: 0 -il-o-b-----
sg.F01060 capacity: 39.1G space: 0 -il-o-b----f
sg.F01061 capacity: 39.1G space: 0 -il-o-b----f
sg.F01062 capacity: 39.1G space: 0 -il-o-b----f
sg.F01063 capacity: 39.1G space: 0 -il-o-b-----
sg.F01064 capacity: 39.1G space: 0 -il-o-b----f
sg.F01065 capacity: 39.1G space: 0 -il-o-b----f
sg.F01066 capacity: 39.1G space: 0 -il-o-b----f
sg.F01067 capacity: 39.1G space: 0 -il-o-b-----
sg.F01068 capacity: 39.1G space: 0 -il-o-b----f
sg.F01069 capacity: 39.1G space: 0 -il-o-b----f
sg.F01070 capacity: 39.1G space: 0 -il-o-b----f
sg.F01071 capacity: 39.1G space: 0 -il-o-b-----
sg.F01072 capacity: 39.1G space: 0 -il-o-b----f
sg.F01073 capacity: 39.1G space: 0 -il-o-b----f
sg.F01074 capacity: 39.1G space: 0 -il-o-b----f
sg.F01075 capacity: 39.1G space: 0 -il-o-b-----
sg.H01078 capacity: 39.1G space: 0 -il-o-b----f
sg.H01079 capacity: 39.1G space: 0 -il-o-b----f
sg.H01080 capacity: 39.1G space: 0 -il-o-b-----
sg.H01081 capacity: 39.1G space: 0 -il-o-b-----
sg.H01082 capacity: 39.1G space: 0 -il-o-b----f
sg.H01083 capacity: 39.1G space: 0 -il-o-b----f
sg.H01084 capacity: 39.1G space: 0 -il-o-b----f
sg.H01085 capacity: 39.1G space: 0 -il-o-b-----
sg.H01086 capacity: 39.1G space: 0 -il-o-b-----
sg.H01087 capacity: 39.1G space: 0 -il-o-b----f
sg.H01088 capacity: 39.1G space: 0 -il-o-b----f
sg.H01089 capacity: 39.1G space: 0 -il-o-b----f
sg.H01090 capacity: 39.1G space: 0 -il-o-b-----
sg.H01091 capacity: 39.1G space: 0 -il-o-b----f
sg.H01092 capacity: 39.1G space: 0 -il-o-b----f
sg.H01093 capacity: 39.1G space: 0 -il-o-b----f
sg.H01094 capacity: 39.1G space: 0 -il-o-b----f
sg.H01095 capacity: 39.1G space: 0 -il-o-b----f
sg.H01096 capacity: 39.1G space: 0 -il-o-b----f
sg.H01097 capacity: 39.1G space: 0 -il-o-b----f
sg.H01098 capacity: 39.1G space: 0 -il-o-b----f
sg.H01099 capacity: 39.1G space: 0 -il-o-b----f
sg.H01100 capacity: 39.1G space: 0 -il-o-b----f
sg.H01118 capacity: 39.1G space: 0 -il-o-b----f
sg.H01101 capacity: 39.1G space: 0 -il-o-b----f
sg.H01102 capacity: 39.1G space: 0 -il-o-b----f
sg.H01103 capacity: 39.1G space: 0 -il-o-b----f
sg.H01104 capacity: 39.1G space: 0 -il-o-b----f
sg.H01105 capacity: 39.1G space: 0 -il-o-b----f
sg.H01106 capacity: 39.1G space: 0 -il-o-b----f
sg.H01107 capacity: 39.1G space: 0 -il-o-b----f
sg.H01108 capacity: 39.1G space: 0 -il-o-b-----
sg.H01109 capacity: 39.1G space: 0 -il-o-b----f
sg.H01110 capacity: 39.1G space: 0 -il-o-b----f
sg.H01111 capacity: 39.1G space: 0 -il-o-b----f
sg.H01112 capacity: 39.1G space: 0 -il-o-b-----
sg.H01113 capacity: 39.1G space: 0 -il-o-b----f
sg.H01114 capacity: 39.1G space: 0 -il-o-b----f
sg.H01115 capacity: 39.1G space: 0 -il-o-b----f
sg.H01116 capacity: 39.1G space: 0 -il-o-b----f
sg.H01117 capacity: 39.1G space: 0 -il-o-b----f
sg.F01076 capacity: 39.1G space: 0 -il-o-b----f
sg.H01050 capacity: 39.1G space: 0 -il-o-b----f
sg.F01077 capacity: 39.1G space: 0 -il-o-b-----
sg.F01078 capacity: 39.1G space: 0 -il-o-b----f
sg.F01079 capacity: 39.1G space: 0 -il-o-b----f
sg.F01080 capacity: 39.1G space: 0 -il-o-b----f
sg.F01081 capacity: 39.1G space: 0 -il-o-b-----
sg.F01082 capacity: 39.1G space: 0 -il-o-b----f
sg.F01083 capacity: 39.1G space: 0 -il-o-b----f
sg.F01084 capacity: 39.1G space: 0 -il-o-b----f
sg.F01085 capacity: 39.1G space: 0 -il-o-b-----
sg.H01051 capacity: 39.1G space: 0 -il-o-b-----
sg.H01061 capacity: 39.1G space: 0 -il-o-b-----
sg.H01062 capacity: 39.1G space: 0 -il-o-b-----
sg.H01063 capacity: 39.1G space: 0 -il-o-b-----
sg.H01064 capacity: 39.1G space: 0 -il-o-b----f
sg.H01065 capacity: 39.1G space: 0 -il-o-b----f
sg.H01066 capacity: 39.1G space: 0 -il-o-b-----
sg.H01067 capacity: 39.1G space: 0 -il-o-b-----
sg.H01068 capacity: 39.1G space: 0 -il-o-b-----
sg.H01069 capacity: 39.1G space: 0 -il-o-b----f
sg.H01070 capacity: 39.1G space: 0 -il-o-b----f
sg.H01071 capacity: 39.1G space: 0 -il-o-b----f
sg.H01072 capacity: 39.1G space: 0 -il-o-b----f
sg.H01073 capacity: 39.1G space: 0 -il-o-b----f
sg.H01074 capacity: 39.1G space: 0 -il-o-b----f
sg.H01075 capacity: 39.1G space: 0 -il-o-b----f
sg.H01076 capacity: 39.1G space: 0 -il-o-b----f
sg.F01086 capacity: 39.1G space: 0 -il-o-b-----
sg.F01087 capacity: 39.1G space: 0 -il-o-b----f
sg.F01088 capacity: 39.1G space: 0 -il-o-b----f
sg.F01089 capacity: 39.1G space: 0 -il-o-b-----
sg.F01090 capacity: 39.1G space: 0 -il-o-b----f
sg.F01091 capacity: 39.1G space: 0 -il-o-b----f
sg.F01092 capacity: 39.1G space: 0 -il-o-b----f
sg.F01093 capacity: 39.1G space: 0 -il-o-b----f
sg.F01094 capacity: 39.1G space: 0 -il-o-b----f
sg.F01095 capacity: 39.1G space: 0 -il-o-b----f
sg.F01096 capacity: 39.1G space: 0 -il-o-b----f
sg.F01097 capacity: 39.1G space: 0 -il-o-b----f
sg.F01098 capacity: 39.1G space: 0 -il-o-b-----
sg.F01099 capacity: 39.1G space: 0 -il-o-b-----
sg.F01100 capacity: 39.1G space: 0 -il-o-b-----
sg.F01101 capacity: 39.1G space: 0 -il-o-b----f
sg.F01102 capacity: 39.1G space: 0 -il-o-b-----
sg.F01103 capacity: 39.1G space: 0 -il-o-b----f
sg.F01104 capacity: 39.1G space: 0 -il-o-b-----
sg.F01105 capacity: 39.1G space: 0 -il-o-b-----
sg.L01000 capacity: 39.1G space: 13.6G -il-o-b-----
sg.L01001 capacity: 39.1G space: 39.1G -il-o-b-----
sg.L01002 capacity: 20.0G space: 20.0G -il-o-b-----
sg.L01003 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01119 capacity: 39.1G space: 0 -il-o-b----f
sg.H01120 capacity: 39.1G space: 0 -il-o-b----f
sg.H01121 capacity: 39.1G space: 0 -il-o-b----f
sg.H01122 capacity: 39.1G space: 0 -il-o-b----f
sg.H01123 capacity: 39.1G space: 0 -il-o-b----f
sg.H01124 capacity: 39.1G space: 0 -il-o-b----f
sg.H01125 capacity: 39.1G space: 0 -il-o-b----f
sg.H01126 capacity: 39.1G space: 0 -il-o-b-----
sg.H01127 capacity: 39.1G space: 0 -il-o-b----f
sg.H01128 capacity: 39.1G space: 0 -il-o-b----f
sg.F01106 capacity: 39.1G space: 0 -il-o-b----f
sg.F01107 capacity: 39.1G space: 0 -il-o-b----f
sg.F01108 capacity: 39.1G space: 0 -il-o-b----f
sg.F01109 capacity: 39.1G space: 0 -il-o-b----f
sg.F01110 capacity: 39.1G space: 0 -il-o-b----f
sg.F01111 capacity: 39.1G space: 0 -il-o-b----f
sg.F01112 capacity: 39.1G space: 0 -il-o-b-----
sg.F01113 capacity: 39.1G space: 0 -il-o-b----f
sg.F01114 capacity: 39.1G space: 0 -il-o-b----f
sg.F01115 capacity: 39.1G space: 0 -il-o-b----f
sg.F01116 capacity: 39.1G space: 0 -il-o-b----f
sg.F01117 capacity: 39.1G space: 0 -il-o-b----f
sg.F01118 capacity: 39.1G space: 0 -il-o-b----f
sg.F01119 capacity: 39.1G space: 0 -il-o-b----f
sg.F01120 capacity: 39.1G space: 0 -il-o-b----f
sg.F01121 capacity: 39.1G space: 0 -il-o-b-----
sg.F01122 capacity: 39.1G space: 0 -il-o-b----f
sg.F01123 capacity: 39.1G space: 0 -il-o-b----f
sg.F01124 capacity: 39.1G space: 0 -il-o-b-----
sg.F01125 capacity: 39.1G space: 0 -il-o-b----f
sg.H01129 capacity: 39.1G space: 0 -il-o-b----f
sg.H01130 capacity: 39.1G space: 0 -il-o-b----f
sg.H01131 capacity: 39.1G space: 0 -il-o-b----f
sg.H01132 capacity: 39.1G space: 0 -il-o-b----f
sg.H01133 capacity: 39.1G space: 0 -il-o-b----f
sg.H01134 capacity: 39.1G space: 29.0G -il-o-b-----
sg.H01135 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01136 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01137 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01138 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01139 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01140 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01141 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01142 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01143 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01144 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01145 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01146 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01147 capacity: 20.0G space: 20.0G -il-o-b-----
sg.H01148 capacity: 20.0G space: 20.0G -il-o-b-----
sg.F01126 capacity: 39.1G space: 0 -il-o-b----f
sg.F01127 capacity: 39.1G space: 0 -il-o-b----f
sg.F01128 capacity: 39.1G space: 0 -il-o-b----f
sg.F01129 capacity: 39.1G space: 0 -il-o-b-----
sg.F01130 capacity: 39.1G space: 0 -il-o-b----f
sg.F01131 capacity: 39.1G space: 0 -il-o-b----f
sg.F01132 capacity: 39.1G space: 0 -il-o-b----f
sg.F01133 capacity: 39.1G space: 321.7M -il-o-b-----
sg.F01134 capacity: 39.1G space: 31.4G -il---b-----
sg.F01135 capacity: 20.0G space: 20.0G -il-o-b-----
sg.F01136 capacity: 20.0G space: 20.0G -il-o-b-----
sg.F01137 capacity: 20.0G space: 20.0G -il-o-b-----
sg.F01138 capacity: 20.0G space: 20.0G -il-o-b-----
sg.F01139 capacity: 20.0G space: 20.0G -il-o-b-----
sg.F01140 capacity: 20.0G space: 20.0G -il-o-b-----

Device:stk900 drives_available:4 archive_drives:4
Catalog:
sf.L02001 capacity: 189.1G space: 188.7G -il-o-b-----
sf.L02002 capacity: 189.1G space: 188.9G -il-o-b-----
sf.L02003 capacity: 60.0G space: 59.9G -il-o-b---d-
sf.STK000 capacity: 189.1G space: 60.8G -il-o-b-----
sf.STK005 capacity: 189.1G space: 60.9G -il-o-b-----
sf.F02028 capacity: 189.1G space: 187.3G -il-o-b---d-
sf.F02029 capacity: 189.1G space: 179.9G -il---b-----
sf.F02030 capacity: 189.1G space: 187.1G -il-o-b-----
sf.F02031 capacity: 60.0G space: 59.9G -il-o-b-----
sf.F02032 capacity: 60.0G space: 59.9G -il-o-b-----
sf.F02033 capacity: 60.0G space: 59.9G -il-o-b-----
sf.F02034 capacity: 60.0G space: 59.9G -il-o-b-----
sf.F02035 capacity: 60.0G space: 59.9G -il-o-b-----
sf.F02036 capacity: 60.0G space: 59.9G -il-o-b-----
sf.H02042 capacity: 189.1G space: 186.5G -il-o-b-----
sf.F02012 capacity: 189.1G space: 69.5G -il-o-b-----
sf.F02028 capacity: 189.1G space: 187.6G -il-o-b---d-
sf.H02035 capacity: 189.1G space: 95.0G -il-o-b-----
sf.H02036 capacity: 60.0G space: 59.9G -il-o-b-----
sf.H02037 capacity: 60.0G space: 59.9G -il-o-b-----
sf.H02038 capacity: 60.0G space: 59.9G -il-o-b-----
sf.H02039 capacity: 60.0G space: 59.9G -il-o-b-----
sf.H02040 capacity: 60.0G space: 59.9G -il-o-b-----
sf.H02041 capacity: 60.0G space: 59.9G -il-o-b-----

Device:DiskArchive drives_available:4 archive_drives:4


Archive file selections:
Filesystem original1 interval: 900
Logfile: /asmcat/logs/archiver.log
original1 Metadata
copy:1 arch_age:1576800000
back path:backup
copy:1 Norelease arch_age:60
copy:2 Norelease arch_age:60

Filesystem clinical1 interval: 900
Logfile: /asmcat/logs/archiver.log
clinical1 Metadata
copy:1 arch_age:1576800000
back path:backup
copy:1 Norelease arch_age:60
copy:2 Norelease arch_age:60

Filesystem heartlab interval: 900
Logfile: /asmcat/logs/archiver.log
heartlab Metadata
copy:1 arch_age:1576800000
back path:backup
copy:1 Norelease arch_age:60
copy:2 Norelease arch_age:60

Filesystem lanv interval: 900
Logfile: /asmcat/logs/archiver.log
lanv Metadata
copy:1 arch_age:1576800000
back path:backup
copy:1 Norelease arch_age:60
copy:2 Norelease arch_age:60

Filesystem darch interval: 900
Logfile: /asmcat/logs/archiver.log
darch Metadata
copy:1 arch_age:1576800000

Filesystem lanv1 interval: 900
Logfile: /asmcat/logs/archiver.log
lanv1 Metadata
copy:1 arch_age:1576800000
back path:backup
copy:1 Norelease arch_age:60
copy:2 Norelease arch_age:60


Archive sets:
allsets


back.1
media: sf
Volumes:
STK000
Total space available: 60.8G

back.2
media: sf
Volumes:
STK005
Total space available: 60.9G

clinical1.1
media: sf
Volumes:
STK000
Total space available: 60.8G

darch.1
media: sf
Volumes:
STK000
Total space available: 60.8G

fs_clinical.1
Destination: disk1 (/darchive/data1)

fs_clinical.2
sort:path
media: sg
Volumes:
F01133
F01134
F01135
F01136
F01137
F01138
F01139
F01140
Total space available: 151.6G

fs_clinical.3
sort:path
media: sf
Volumes:
F02029
F02030
F02031
F02032
F02033
F02034
F02035
F02036
F02012
Total space available: 796.1G

fs_heartlab.1
sort:path
media: sg
Volumes:
H01134
H01135
H01136
H01137
H01138
H01139
H01140
H01141
H01142
H01143
H01144
H01145
H01146
H01147
H01148
Total space available: 308.7G

fs_heartlab.2
sort:path
media: sf
Volumes:
H02042
H02035
H02036
H02037
H02038
H02039
H02040
H02041
Total space available: 641.2G

fs_lanv1.1
Destination: disk2 (/darchive/data2)

fs_lanv1.2
sort:path
media: sg
Volumes:
L01000
L01001
L01002
L01003
Total space available: 92.7G

fs_lanv1.3
sort:path
media: sf
Volumes:
L02001
L02002
Total space available: 377.6G

fs_lanvision.1
Destination: disk3 (/darchive/data3)

fs_lanvision.2
sort:path
media: sg
Volumes:
L01000
L01001
L01002
L01003
Total space available: 92.7G

fs_lanvision.3
sort:path
media: sf
Volumes:
L02001
L02002
Total space available: 377.6G

fs_original.1
Destination: disk0 (/darchive/data)

fs_original.2
sort:path
media: sg
Volumes:
F01133
F01134
F01135
F01136
F01137
F01138
F01139
F01140
Total space available: 151.6G

fs_original.3
sort:path
media: sf
Volumes:
F02029
F02030
F02031
F02032
F02033
F02034
F02035
F02036
F02012
Total space available: 796.1G

heartlab.1
media: sf
Volumes:
STK000
Total space available: 60.8G

lanv.1
media: sf
Volumes:
STK000
Total space available: 60.8G

lanv1.1
media: sf
Volumes:
STK000
Total space available: 60.8G

original1.1
media: sf
Volumes:
STK000
Total space available: 60.8G





Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams


Dave Gray

2005-08-02, 5:00 pm

On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
> I think I am on the right track as far as what assertion to use. I need =

to
> print from one string to another using .. with \G


Why do you want to use \G?

> My goal is to capture from allsets down.
> Here is my code:
>=20
> #!/usr/bin/perl
> use strict;
> use warnings;
> $ENV{PATH} =3D qq(/opt/SUNWsamfs/sbin:/usr/bin);
> open (ARC, "archiver -lv |") or die $!;
>=20
> foreach (<ARC> )
> {
> ##-- Tape --##
> if (/allsets/ .. /fs_clinical.1/)


You need to escape dots in regular expressions '\.'

> {
> print $_;
> my $tape =3D$1;


Your regex isn't capturing anything, so $1 will always be undefined.

> } else {
> / \G 'heartlab.1'/


What are you trying to do here? You need to escape dots in regular
expressions '\.'

> }
> }
> close (ARC);


I think you would benefit greatly from trying to generalize your
problem and writing a simple test script that simulates the problem
you're trying to solve. Then if you're still stuck, post that test
script here, as opposed to that 5 billion line data file which is
mostly irrelevant anyway.
DBSMITH@OhioHealth.com

2005-08-02, 5:00 pm

Dave,

technically you are correct about escaping the dot, but in this particular
situation my regexp is working. I will escape the dot.
my goal again is to print from one sting to another.... from "allsets"
down. I apologize for the long output if data, but I want to reflect 100%
accuracy.

Any ideas on a simple for loop with a regexp?

thanks





Dave Gray
<yargevad@gmail.c
om> To
beginners@perl.org
08/02/2005 02:19 cc
PM
Subject
Re: reg exp using \G
Please respond to
Dave Gray
<yargevad@gmail.c
om>






On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
> I think I am on the right track as far as what assertion to use. I need

to
> print from one string to another using .. with \G


Why do you want to use \G?

> My goal is to capture from allsets down.
> Here is my code:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> $ENV{PATH} = qq(/opt/SUNWsamfs/sbin:/usr/bin);
> open (ARC, "archiver -lv |") or die $!;
>
> foreach (<ARC> )
> {
> ##-- Tape --##
> if (/allsets/ .. /fs_clinical.1/)


You need to escape dots in regular expressions '\.'

> {
> print $_;
> my $tape =$1;


Your regex isn't capturing anything, so $1 will always be undefined.

> } else {
> / \G 'heartlab.1'/


What are you trying to do here? You need to escape dots in regular
expressions '\.'

> }
> }
> close (ARC);


I think you would benefit greatly from trying to generalize your
problem and writing a simple test script that simulates the problem
you're trying to solve. Then if you're still stuck, post that test
script here, as opposed to that 5 billion line data file which is
mostly irrelevant anyway.

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




John Doe

2005-08-02, 5:00 pm

DBSMITH@ohiohealth.com am Dienstag, 2. August 2005 19.36:
> reg exp using \G
> Datum: 2.8.05 =A019:36:44
> Von: DBSMITH@ohiohealth.com
> An: beginners@perl.org
>
> All,
>
> I think I am on the right track as far as what assertion to use. =A0I nee=

d to
> print from one string to another using .. with \G


Your boss the reason that you *need* to? ;-)

> My goal is to capture from allsets down.
>
> thank you
>
>
>
> Here is my code:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> $ENV{PATH} =3D qq(/opt/SUNWsamfs/sbin:/usr/bin);


Nice to see :-)

> open (ARC, "archiver -lv |") or die $!;
>
> =A0 =A0 =A0 =A0 foreach (<ARC> )
> =A0 =A0 =A0 =A0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ##-- Tape --##
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (/allsets/ .. /fs_clinical.1/)


You are in your foreach loop. $_ contains *one* line. I've the impression t=
hat=20
here you somehow want to treat multiple lines with your if condition.

BTW, the "." in your regex stands for any char, not for a literal ".".

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 print $_;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 my $tape =3D$1;


You didn't capture in a regex, so $1 contains nothing.

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else {
> =A0 =A0 =A0 / =A0\G 'heartlab.1'/


\G is not usable here: It refers to the last match of the *same* string. B=
ut=20
a "last match" doesn't occur in the program flow: Per line in the foreach=
=20
loop, you visit either the if or the else part.

> =A0 =A0 =A0 }
> =A0 =A0 =A0 =A0 }
> close (ARC);


add a "or die" or at least "or warn" here.

>
> __END_CODE__
> __BEGIN_DATA__


Your problem, if I understand it, is to extract some adjacent lines, the fi=
rst=20
line and the last line containing a keyword.

One approach (and not the best/shortest I suppose) could be:
=2D read in lines until the start line is found
=2D accumulate additional lines until end line is found.

[...snipped most of the big data]

> Archive sets:
> allsets
>
>
> back.1
> =A0media: sf
> =A0Volumes:
> =A0 =A0STK000
> =A0Total space available: =A0 60.8G
>
> back.2
> =A0media: sf
> =A0Volumes:
> =A0 =A0STK005
> =A0Total space available: =A0 60.9G
>
> clinical1.1
> =A0media: sf
> =A0Volumes:
> =A0 =A0STK000
> =A0Total space available: =A0 60.8G
>
> darch.1
> =A0media: sf
> =A0Volumes:
> =A0 =A0STK000
> =A0Total space available: =A0 60.8G
>
> fs_clinical.1
> =A0Destination: disk1 (/darchive/data1)

[...]
Dave Gray

2005-08-02, 5:00 pm

On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
> technically you are correct about escaping the dot, but in this particula=

r
> situation my regexp is working. I will escape the dot.
> my goal again is to print from one sting to another.... from "allsets"
> down. I apologize for the long output if data, but I want to reflect 100=

%
> accuracy.
>=20
> Any ideas on a simple for loop with a regexp?


for (<ARC> ) {
print if /one string/ .. /another/;
}

You already had that solution, though. What am I missing?
DBSMITH@OhioHealth.com

2005-08-02, 5:00 pm

yes but the problem is my start point and end point have identical entries
under them. It is stopping at original1.1 when I need for it to stop at
the end of original1.1 and print

media: sf
Volumes:
STK000
Total space available: 60.8G

as opposed to just allsets to original1.1

For example, stops at original1.1


for (<ARC> ) {
print if /allsets/ .. /original1\.1/;
}


and in the data file:

Archive sets:
allsets


back.1
media: sf
Volumes:
STK000
Total space available: 60.8G

back.2
media: sf
Volumes:
STK005
Total space available: 60.9G

clinical1.1
media: sf
Volumes:
STK000
Total space available: 60.8G

darch.1
media: sf
Volumes:
STK000
Total space available: 60.8G

fs_clinical.1
Destination: disk1 (/darchive/data1)

fs_clinical.2
sort:path
media: sg
Volumes:
F01133
F01134
F01135
F01136
F01137
F01138
F01139
F01140
Total space available: 151.6G

fs_clinical.3
sort:path
media: sf
Volumes:
F02029
F02030
F02031
F02032
F02033
F02034
F02035
F02036
F02012
Total space available: 796.1G

fs_heartlab.1
sort:path
media: sg
Volumes:
H01134
H01135
H01136
H01137
H01138
H01139
H01140
H01141
H01142
H01143
H01144
H01145
H01146
H01147
H01148
Total space available: 308.7G

fs_heartlab.2
sort:path
media: sf
Volumes:
H02042
H02035
H02036
H02037
H02038
H02039
H02040
H02041
Total space available: 641.2G

fs_lanv1.1
Destination: disk2 (/darchive/data2)

fs_lanv1.2
sort:path
media: sg
Volumes:
L01000
L01001
L01002
L01003
Total space available: 92.7G

fs_lanv1.3
sort:path
media: sf
Volumes:
L02001
L02002
Total space available: 377.6G

fs_lanvision.1
Destination: disk3 (/darchive/data3)

fs_lanvision.2
sort:path
media: sg
Volumes:
L01000
L01001
L01002
L01003
Total space available: 92.7G

fs_lanvision.3
sort:path
media: sf
Volumes:
L02001
L02002
Total space available: 377.6G

fs_original.1
Destination: disk0 (/darchive/data)

fs_original.2
sort:path
media: sg
Volumes:
F01133
F01134
F01135
F01136
F01137
F01138
F01139
F01140
Total space available: 151.6G

fs_original.3
sort:path
media: sf
Volumes:
F02029
F02030
F02031
F02032
F02033
F02034
F02035
F02036
F02012
Total space available: 796.1G

heartlab.1
media: sf
Volumes:
STK000
Total space available: 60.8G

lanv.1
media: sf
Volumes:
STK000
Total space available: 60.8G

lanv1.1
media: sf
Volumes:
STK000
Total space available: 60.8G

original1.1 #### Stopping here #####
media: sf
Volumes:
STK000
Total space available: 60.8G

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams





Dave Gray
<yargevad@gmail.c
om> To
beginners@perl.org
08/02/2005 02:46 cc
PM
Subject
Re: reg exp using \G
Please respond to
Dave Gray
<yargevad@gmail.c
om>






On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
> technically you are correct about escaping the dot, but in this

particular
> situation my regexp is working. I will escape the dot.
> my goal again is to print from one sting to another.... from "allsets"
> down. I apologize for the long output if data, but I want to reflect

100%
> accuracy.
>
> Any ideas on a simple for loop with a regexp?


for (<ARC> ) {
print if /one string/ .. /another/;
}

You already had that solution, though. What am I missing?

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Dave Gray

2005-08-02, 5:00 pm

On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
> yes but the problem is my start point and end point have identical entrie=

s
> under them. It is stopping at original1.1 when I need for it to stop at
> the end of original1.1 and print
>=20
> media: sf
> Volumes:
> STK000
> Total space available: 60.8G
>=20
> as opposed to just allsets to original1.1


Here's a test program that demonstrates how to do that.

#!/usr/bin/perl
use strict;
use warnings;

while (<DATA> ) {
if (/AA/ ... /(CC)/) {
print;
if ($1) {
while (<DATA> ) {
# this regex defines when your section is done
last if /^\s*$/;
print;
}
}
}
}

__DATA__
AA

BB

CC
DD
EE

FF
GG

HH
II
Dave Gray

2005-08-02, 5:00 pm

On 8/2/05, Dave Gray <yargevad@gmail.com> wrote:
> On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
ies[color=darkred]
t[color=darkred]
>=20
> Here's a test program that demonstrates how to do that.
>=20
> #!/usr/bin/perl
> use strict;
> use warnings;
>=20
> while (<DATA> ) {
> if (/AA/ ... /(CC)/) {
> print;
> if ($1) {
> while (<DATA> ) {
> # this regex defines when your section is done
> last if /^\s*$/;
> print;
> }


# so you don't have to spin over the rest of the file
last;

> }
> }
> }
>=20
> __DATA__
> AA
>=20
> BB
>=20
> CC
> DD
> EE
>=20
> FF
> GG
>=20
> HH
> II
>

DBSMITH@OhioHealth.com

2005-08-02, 5:00 pm

ok I understand now...thanks, but I tried it and it is still stopping at
original1.1
I then modified it to print YESSSS if ($1) but never saw YESSSS in STDOUT.






Dave Gray
<yargevad@gmail.c
om> To
beginners@perl.org
08/02/2005 03:11 cc
PM
Subject
Re: reg exp using \G
Please respond to
Dave Gray
<yargevad@gmail.c
om>






On 8/2/05, Dave Gray <yargevad@gmail.com> wrote:
> On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
entries[color=darkred]
at[color=darkred]
>
> Here's a test program that demonstrates how to do that.
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> while (<DATA> ) {
> if (/AA/ ... /(CC)/) {
> print;
> if ($1) {
> while (<DATA> ) {
> # this regex defines when your section is done
> last if /^\s*$/;
> print;
> }


# so you don't have to spin over the rest of the file
last;

> }
> }
> }
>
> __DATA__
> AA
>
> BB
>
> CC
> DD
> EE
>
> FF
> GG
>
> HH
> II
>


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Jay Savage

2005-08-02, 5:00 pm

Please don't top post. I think you've been asked this before.


On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
> ok I understand now...thanks, but I tried it and it is still stopping at
> original1.1
> I then modified it to print YESSSS if ($1) but never saw YESSSS in STDOUT=

..


Tha's because as a one liner it doesn't use parentheses. And also
becuase YESSSSS isn't a string, it's a constant. Do you have warnings
turned on? warnings and strict would catch these sorts of things.

print "Yes" if $1; # or
if ($1) {print "Yes"}

Your choice.

[color=darkred]
>=20
> # so you don't have to spin over the rest of the file
> last;
>=20

I think we need a clearer description of what you want to do here. At
least I do. will your last line have "original.1"? Or will it have
something else? i don't think anyone knows what "the "end of
original.1" means. "original.1" is a string, and the current code
matches that string. If you need to match the end of the string, use
'/original\.1$/'.

I think, though that you mean the end of some block of lines in your data f=
ile.=20

It looks to me like you want something along the lines of :

while(<> ) {
if (/allsets/ .. /original\.1/) {
print;
} elsif (/media/ .. /Total/) {
print;
}
}

-- j
--------------------------------------------------
This email and attachment(s): [ ] blogable; [ x ] ask first; [ ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com http://www.dpguru.com http://www.engatiki.org
DBSMITH@OhioHealth.com

2005-08-03, 10:00 pm


Jay Savage
<daggerquill@gmai
l.com> To
"DBSMITH@ohiohealth.com"
08/02/2005 05:43 <DBSMITH@ohiohealth.com>, beginners
PM perl <beginners@perl.org>
cc

Please respond to Subject
Jay Savage Re: reg exp using \G
<daggerquill@gmai
l.com>











Please don't top post. I think you've been asked this before.


On 8/2/05, DBSMITH@ohiohealth.com <DBSMITH@ohiohealth.com> wrote:
> ok I understand now...thanks, but I tried it and it is still stopping at
> original1.1
> I then modified it to print YESSSS if ($1) but never saw YESSSS in

STDOUT.


Tha's because as a one liner it doesn't use parentheses. And also
becuase YESSSSS isn't a string, it's a constant. Do you have warnings
turned on? warnings and strict would catch these sorts of things.

print "Yes" if $1; # or
if ($1) {print "Yes"}

Your choice.

[color=darkred]
>
> # so you don't have to spin over the rest of the file
> last;
>

I think we need a clearer description of what you want to do here. At
least I do. will your last line have "original.1"? Or will it have
something else? i don't think anyone knows what "the "end of
original.1" means. "original.1" is a string, and the current code
matches that string. If you need to match the end of the string, use
'/original\.1$/'.

I think, though that you mean the end of some block of lines in your data
file.

It looks to me like you want something along the lines of :

while(<> ) {
if (/allsets/ .. /original\.1/) {
print;
} elsif (/media/ .. /Total/) {
print;
}
}

-- j
--------------------------------------------------



BOTTOM POST

I got it working and the code I am using is now

open (ARC, "archiver -lv |") or die $!;
my $flag=0;
foreach (<ARC> )
{
if (/(?i)allsets/)
{
$flag=1;
}
if ($flag==1)
{
print $_;
}
}

as opposed to

if (/allsets/ .. /original1.1/ )

because I needed the data after original1.1.

thank you
derek





Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com