On Tue, Feb 06, 2001 at 12:23:35PM -0500, Clarence Donath wrote:
Hi Clarence Donath
mrdo.com
Thank you very much for the help, and in perl, lovely.
I can compare it with my tutorial to better understand it.
> > Find string `boundary"`
> > put string `----=_NextPart_001_004B_01C08570.D30AB6E0` into "$variable"
> > find next "$variable" # skip this one
> > find next "$variable" # skip this one
> > replace "$variable" with xxxxxx+"$variable"
> > write balance of file to outputfile.
> I'm typing this up as I would write it. It's not been tested, but perhaps
> could give you a start.
> open(INFILE, 'readfile') || die $!;
> open(OUTFILE, '>writefile') || die $!;
> my $variable;
> my $count;
> foreach $string (<INFILE>) {
> if ( $string =~ /boundary\"/ ) {
> $variable = '----=_NextPart_001_004B_01C08570.D30AB6E0';
-------------------------
What you have done is almost what I want, thank you for that,
but it is evident that I have not explained it very well.
What I want perl to do, is to read the string in from the file
and put it in $variable .
This $variable string is changing from file to file.
a few examples of strings in different files:
boundary="----=_NextPart_001_004B_01C08570.D30AB6E0"
boundary="----=_NextPart_001_0078_01C08533.7A1819C0"
boundary="----=_NextPart_000_01C08542.17EE41C0"
boundary="==i3.9.0oisdboibsd((kncd"
$variable is starting with a ( " ) and ending with ( " )
If you can help me with that
then I think I am very close to what I want.
I will also have to take the file names from the command line.
A suggestion for that is much appriciated.
-------------------------
> }
> if ( $variable ) {
> $count++;
> if ( $count == 3 ) {
> $string = 'xxxxxx' . $variable;
> }
> }
> print OUTFILE $string;
> }
> close INFILE;
> close OUTFILE;
-----------------------------------------------
Best regards
Mettavihari
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list