in reply to Match but ignore white space

Basically, check that all lines in FILE1 are resident in FILE2

I don't know if I'd even use perl for the bulk of this -- `diff -b` will ignore whitespace. If the lines might appear in different order between the two files, sort them first.

You can then use perl to process the output, so you can accept the case of line in FILE2 that aren't in FILE1.

Replies are listed 'Best First'.
Re^2: Match but ignore white space
by pc88mxer (Vicar) on May 09, 2008 at 17:10 UTC
    Unfortunately you'd have to first sort the files ignoring the white space in the special way you want to ignore the white space, and standard Unix sort only has the option to ignore leading blanks.

    Another Unix utility suitable for this type of task is comm, although it also requires input that already has been sorted.