-1

I am looking for a perl script able to decode multiple lines of Base64 encoded strings. I found a few tools to do the job line by line. Which is really time consuming considering the amount of lines that I have. I can have all the strings in one base file called "infile.txt", would that be possible to run a perl script to convert all the lines in "infile.txt" to "outfile.txt" and keeping one line per string?

Thanks for guiding me.

1 Answers1

1

If each line was the result of an encode:

while (<>)
   chomp;
   print decode_base64($_), "\n";
}

If the entire file was the result of an encode:

local $/;
while (<>) {
   print decode_base64($_);
}
ikegami
  • 367,544
  • 15
  • 269
  • 518