in reply to Re: Re: Re: Re: pattern matching between two specific strings
in thread pattern matching between two specific strings
Update: Added a / at line 12.#!/usr/local/bin/perl $in_filename = "graph_set.out"; open (IN,"$in_filename") or die "Can't open $in_filename:$!\n"; my $dsno; while(<IN>){ if(/Final graph set matrix/){ print "\n", $dsno++, " data set\n"; } if(/Final graph set matrix/ .. /PLUTO4 finished/){ my @gset_match = ($string =~ /([A-Z]\s\d+,\s\d+\(\s*\d+\))/g); open (TEXT, ">>graph_set.txt") or die "Can't create graph_set.txt: + $!\n"; foreach $_(@gset_match) { print TEXT "$_\n"; } close TEXT; } } close (IN);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Re: pattern matching between two specific strings
by harry34 (Sexton) on Jul 14, 2003 at 12:51 UTC | |
by zby (Vicar) on Jul 14, 2003 at 13:09 UTC | |
by harry34 (Sexton) on Jul 14, 2003 at 13:18 UTC | |
by zby (Vicar) on Jul 14, 2003 at 13:22 UTC | |
by harry34 (Sexton) on Jul 14, 2003 at 13:43 UTC | |
|