-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
5 changed files
with
23,748 additions
and
15 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,15 @@ | ||
import csv | ||
|
||
def convert_to_csv(input_file, output_file): | ||
with open(input_file, 'r') as infile, open(output_file, 'w', newline='') as outfile: | ||
csv_writer = csv.writer(outfile) | ||
|
||
for line in infile: | ||
# Strip whitespace and split the line by tabs or multiple spaces | ||
row = line.strip().split() | ||
if len(row) == 8: # Ensure we have the correct number of columns | ||
csv_writer.writerow(row) | ||
|
||
if __name__ == "__main__": | ||
convert_to_csv('matches.txt', 'matches.csv') | ||
print("Conversion complete. Data saved to matches.csv") |
Oops, something went wrong.