Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #
  3. # edits and renames all the trace files to the correct tune bits(the last three numbers in the filename)
  4. # then copies them to the correct subdirectory(must be made first)
  5.  
  6. $dir="/cygdrive/h/IBM/csoi7sf/kingcobra/sim/trace/SUH/";
  7. $new_dir="/cygdrive/h/IBM/csoi7sf/kingcobra/sim/trace/SUH/finetune001/"; #change to new directory, must have trailing slash
  8.  
  9. open(readfile, "/cygdrive/h/IBM/csoi7sf/kingcobra/sim/trace/SUH/files") or die $!;
  10. @files = <readfile>;
  11. close(readfile);
  12. for(@files){
  13. print("$dir$_\n");
  14. open(readfile, "$dir$_");
  15. $_ =~ s/_000.trc/_001.trc/;
  16. @lines = <readfile>;
  17. $lines[23] =~ s/0000000011/0010000011/;
  18. $lines[24] =~ s/0000001011/0010001011/;
  19. $lines[25] =~ s/0000000011/0010000011/;
  20. close(readfile);
  21. print("@lines");
  22. print("$new_dir$_\n");
  23. open(writefile, ">", "$new_dir$_") || die $!;
  24. print writefile @lines;
  25. close(writefile);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement