#!/usr/bin/perl -w use strict; use warnings; ## Open I/P File "bsm1_LogFiles" for reading. open(INPUT,'<','bsm1_LogFiles') or die $!; ## Read from the Input File. my $line = ; ## Open the O/P File "BSC" for writing. open(BSC,'>','BSC') or die $!; ## Open the O/P File "SBSCSubsystem" for writing. open(SBSCSubsystem,'>','SBSCSubsystem') or die $!; ## Open the O/P File "MCBTSSubsystem" for writing. open(MCBTSSubsystem,'>','MCBTSSubsystem') or die $!; ## Process input lines into output files. while() { ## For parameter 'BSC-'. if ( /BSC-/ ) { ## Read a line, copy it, and delete 'BSC-' in the copy. chomp $line; my $copy = $_; $copy =~ s/BSC-//; ## Print the original line and the copy. print BSC "$_ $copy\n"; } ## For parameter 'SBSCSubsystem-'. if ( /SBSCSubsystem-/ ) { ## Read a line, copy it, and delete 'SBSCSubsystem-' in the copy. chomp $line; my $copy = $_; $copy =~ s/SBSCSubsystem-//; ## Print the original line and the copy. print SBSCSubsystem "$_ $copy\n"; } ## For parameter 'MCBTSSubsystem-'. if ( /MCBTSSubsystem-/ ) { ## Read a line, copy it, and delete 'MCBTSSubsystem-' in the copy. chomp $line; my $copy = $_; $copy =~ s/MCBTSSubsystem-//; ## Print the original line and the copy. print MCBTSSubsystem "$_ $copy\n"; } } ## Close the I/P File "bsm1_LogFiles"; close (INPUT) or die $!; ## Close the O/P File "BSC"; close (BSC) or die $!; ## Close the O/P File "SBSCSubsystem"; close (SBSCSubsystem) or die $!; ## Close the O/P File "MCBTSSubsystem"; close (MCBTSSubsystem) or die $!;