Link to home
Start Free TrialLog in
Avatar of cels9
cels9

asked on

Text file word search

I have a text file called cool.txt:

lovelovelove.com  Cool1
painpainpain.com  Cool2
expertexpert.com  Cool2

I want this: perl script.pl cool.txt cool1 cool1.txt

the script search the world cool1 in the file cool.txt and creat a file called cool1.txt and past the site(only the site).

cool1.txt:
lovelovelove.com


tnx.
ASKER CERTIFIED SOLUTION
Avatar of rj2
rj2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
/[^\s]/ can also be written /\S/
You might also want to be aware of possible metacharacters in $text