#!/usr/bin/perl open(FILE, "ppc100.rtf"); @file = ; close(FILE); $file = join("", @file); $ctf = "volgactf"; $base64 = ""; for ($pos=0;$pos<=1000;$pos++) { $search = $ctf . $pos . " "; $index = index($file, $search); if ($index != -1) { print "Found $pos\n"; $end = index($file, "}", $index+length($search)); $part = substr($file, $index+length($search), $end-$index-length($search)); $base64 .= $part; } } open(RES, ">result.b64"); print RES $base64; close(RES);