- or download this
Input.txt
2014-04-24 14:22:52|TESTER001||/dev/pts/5|322655663|TYXRRES|0
2014-04-24 14:22:52|TESTER003||/dev/pts/5|323231258|TRRRDER|0
2014-04-24 14:22:52|TESTER002||/dev/pts/5|323135368|RCVDDER|0
- or download this
Changes.txt
TESTER001,Frank_Sinatra
TESTER002,Jhon_Belushi
TESTER003,Homer_Simson
- or download this
Output.txt (desired)
2014-04-24 14:22:52|Frank_Sinatra||/dev/pts/5|322655663|TYXRRES|0
2014-04-24 14:22:52|Homer_Simson||/dev/pts/5|323231258|TRRRDER|0
2014-04-24 14:22:52|Jhon_Belushi||/dev/pts/5|323135368|RCVDDER|0
- or download this
real Output.txt
2014-04-24 14:22:52 Frank_Sinatra /dev/pts/5 322655663 TYXRRES 0
2014-04-24 14:22:52 Homer_Simson /dev/pts/5 323231258 TRRRDER 0
2014-04-24 14:22:52 Jhon_Belushi /dev/pts/5 323135368|RCVDDER|0
- or download this
#!/usr/bin/perl
use warnings;
...
open( my $file_fh, "<", "Input.txt" ) || die "Can't open the Input.txt
+ file: $!";
while (<$file_fh>) {
- or download this
my @line = split( /\|/, $_,);
for my $char ( @line ) {
...
}
print $out_fh "\n";
}