How do I search for a word pattern like "Var_x_longitude"
"Var_y_latitude" two files to see if such words are in these two files?
I was trying to open a file and do a (/\bVar*e\b)
and then try to save it in an array. Then open the 2nd file and compare the array with the pattern. But I failed.
I found out here that there is a
command like
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' fileA fileB >output
but I dont' understand it and it only matches the length of the lines in two files.
I have a variable and want to see if they are used in these 2 files and want to see the display or the lines either on standard out or > output.txt. Can anyone help? I'm not good at programming. Using C seems even harder.
Any help would be appreciated much. Thanks.
DAVE
Edit 2001-03-16 by tye
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.