I have a file that has hundreds of user records in it which each user record is separated with a new line
I'm using a perl command such as
perl -n00e 'print if (/^gram-20020624|^gram-200
20624:Supp
ort|^david
-20010801c
/)' list-file.txt
This command will pull out the user records for these 3 accounts
gram-20020624 gram-20020624:Support david-20010801c
Problem I have is I have a few hundred of the records that I need to pull out and cannot put all of them on the line of the command.
I've tried to put the list of names in a file then create a small perl script and put the list in a array then do a foreach with it but it's not working.
The one liner I used above will pull out these 3 records and look like
david-20010801c: owner=david-20010801c status=enabled
name=David Doe
description=
other owners=
double book=yes
aces=@@o^c^wdeic^g;@@o^a^r
sf^g;@^a^s
f^g;@^c^^g
;@^p^r^g
email=
time zone=
categories=
character set=
language code=en
created=Mar 10, 2005 21:53:44 GMT
last modified=Dec 04, 2005 02:37:42 GMT
events last modified=Jun 29, 2006 16:23:32 GMT
todos last modified=Mar 10, 2005 21:53:44 GMT
deletelog last modified=Mar 10, 2005 21:53:44 GMT
number of events=36
number of tasks=0
gram-20020624: owner=gram-20020624 status=enabled
name=gram Morgan
description=
other owners=
double book=yes
aces=@@o^c^wdeic^g;@@o^a^r
sf^g;@^a^s
f^g;@^c^^g
;@^p^r^g
email=
time zone=
categories=
character set=
language code=en
created=Feb 21, 2007 15:20:18 GMT
last modified=Feb 21, 2007 15:34:25 GMT
events last modified=Dec 17, 2007 15:31:51 GMT
todos last modified=Feb 21, 2007 15:20:18 GMT
deletelog last modified=Aug 10, 2007 11:01:58 GMT
number of events=33
number of tasks=0
gram-20020624:Support: owner=gram-20020624 status=enabled
name=Travel Schedule
description=
other owners=
double book=yes
aces=@@o^c^wdeic^g;@@o^a^r
sf^g;@^a^r
sf^g;@^c^^
g
email=
time zone=America/Denver
categories=
character set=
language code=en
created=Feb 21, 2007 17:14:26 GMT
last modified=Feb 21, 2007 22:32:40 GMT
events last modified=Dec 10, 2007 17:20:28 GMT
todos last modified=Feb 21, 2007 17:14:26 GMT
deletelog last modified=Nov 02, 2007 19:44:39 GMT
number of events=142
number of tasks=0
can someone please show me a easy way to do this, I know it there's a simple way to do this but sure not getting it to work right.
Thanks,
Start Free Trial