hello,
i have a file with contact information for a bunch of people (sometimes
other info)
name: katia
phone: 123-456-789
I want to read through this file and grab everything after name: and the
entire next like and print it in an out file like:
katia,123-456-789
I can parse the file and print the lines, but i haven't figured out how
to get them on the same line or only print what is after name: or phone:
#!/usr/bin/perl
open(FILE, "namelist") or die $!;
while (<FILE>) {
print $_ if(/name/ or /phone/);}
close FILE
the phone # is always right after the name. I want to grab the #'s in
the next line instead of searching for "phone" to ensure i get the
correct phone # with the correct name.
any help or links is appreciated.
thank you
-katia
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]