Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #
- # edits and renames all the trace files to the correct tune bits(the last three numbers in the filename)
- # then copies them to the correct subdirectory(must be made first)
- $dir="/cygdrive/h/IBM/csoi7sf/kingcobra/sim/trace/SUH/";
- $new_dir="/cygdrive/h/IBM/csoi7sf/kingcobra/sim/trace/SUH/finetune001/"; #change to new directory, must have trailing slash
- open(readfile, "/cygdrive/h/IBM/csoi7sf/kingcobra/sim/trace/SUH/files") or die $!;
- @files = <readfile>;
- close(readfile);
- for(@files){
- print("$dir$_\n");
- open(readfile, "$dir$_");
- $_ =~ s/_000.trc/_001.trc/;
- @lines = <readfile>;
- $lines[23] =~ s/0000000011/0010000011/;
- $lines[24] =~ s/0000001011/0010001011/;
- $lines[25] =~ s/0000000011/0010000011/;
- close(readfile);
- print("@lines");
- print("$new_dir$_\n");
- open(writefile, ">", "$new_dir$_") || die $!;
- print writefile @lines;
- close(writefile);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement