Created
March 24, 2025 17:32
-
-
Save 641i130/3f794b890d42f791085c044b77a86cc5 to your computer and use it in GitHub Desktop.
Revisions
-
641i130 created this gist
Mar 24, 2025 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ #!/usr/bin/env python3 import csv import sys # Check if an input file is provided if len(sys.argv) < 2: print("Usage: python convert_to_gitlab.py <input_csv_file>") sys.exit(1) input_file = sys.argv[1] output_file = f"{input_file}_gitlab.csv" # Read the input CSV and write to output in GitLab format with open(input_file, newline='', encoding='utf-8') as csvfile, open(output_file, 'w', newline='', encoding='utf-8') as outfile: reader = csv.DictReader(csvfile) writer = csv.writer(outfile) # Write the header writer.writerow(["title", "description"]) for row in reader: title = row.get("Summary", "").strip() if title: # Ensure title is not empty writer.writerow([title, title]) print(f"Conversion complete. Output saved to {output_file}")