I need your help with formate a txt file using bash/linux. The file looks like the following, it always has a line called Rate: Sth then it follows with the details in the v
#!/usr/bin/perl
use strict;
use warnings;
open (my $out, ">-") or die "oops";
while(<>)
{
if (m/^Rate: (\w+)/o)
{
close $out and open ($out, ">$1") or die "oops";
next;
}
print $out $_
}