This appears to work correctly. Tested with four files.
#!/usr/bin/perl use warnings; use strict; @ARGV > 1 or die "usage: $0 <<MAIN_LIB_FILE>> <<LIB_FILE_FOR_MARGE>> +\n\n"; open my $OUT, '>', 'final_file.dat' or die "Cannot open 'final_file.da +t' because: $!"; while ( <> ) { if ( /^\}$/ .. /^\s+.*\{$/ ) { print $OUT $_ if /^\s+.*\{$/; next; } print $OUT $_; } print $OUT "}\n";
In reply to Re: Merging of files with some edit.
by jwkrahn
in thread Merging of files with some edit.
by anirbanphys
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |