-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bb161e
commit fdbe0f4
Showing
42 changed files
with
26 additions
and
2,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
|
||
|
||
def truncate_file_after_line_70(file_path): | ||
with open(file_path, "r", encoding="utf-8", errors="ignore") as file: | ||
lines = file.readlines() | ||
|
||
if len(lines) > 70: | ||
lines = lines[:70] | ||
|
||
with open(file_path, "w", encoding="utf-8", errors="ignore") as file: | ||
file.writelines(lines) | ||
|
||
|
||
def process_files_in_directory(directory): | ||
for filename in os.listdir(directory): | ||
file_path = os.path.join(directory, filename) | ||
if os.path.isfile(file_path): | ||
truncate_file_after_line_70(file_path) | ||
|
||
|
||
# Specify the directory containing the files | ||
directory = os.path.dirname(os.path.abspath(__file__)) + "/evaluation/" | ||
|
||
# Process each file in the directory | ||
process_files_in_directory(directory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.