aws-samples / aws-samples/sample-rvtools-processor

Does not support csv

Offen
#4 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
9
Forks
4
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

`openpyxl` doesn't support csv so it needs to be handled separately or simply converted to excel first.

While nothing on github indicates it does support CSV, the [blog post](https://aws.amazon.com/blogs/migration-and-modernization/anonymizing-rvtools-data-for-aws-migration-planning/) does. It would be pretty simple to convert it and save temporary xlsx files to then process.
eg:
```python
import csv
from openpyxl import Workbook

def csv_to_excel(csv_file, excel_file):
wb = Workbook()
ws = wb.active
with open(csv_file, 'r', newline='', encoding='utf-8') as f:
reader = csv.reader(f)
for row in reader:
ws.append(row)
wb.save(excel_file)
```

Currently
```
> python rvtools_processor.py consolidate input1.csv input2.csv -o consolidated.csv

Starting consolidation of 2 files...
Processing: input1.csv
Error processing input1.csv: openpyxl does not support .csv file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
Processing: input2.csv
Error processing input2.csv: openpyxl does not support .csv file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
Creating consolidated file: input2.csv
Error: At least one sheet must be visible
```

`Python 3.13.3`

```
Package Version
--------------- -----------
openpyxl 3.1.5
pandas 3.0.1
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in rvtools_processor.py beim consolidate-Befehl und verwende den gemeldeten CSV-Aufruf sowie den openpyxl-Fehler als Einstiegspunkt. Prüfe, wie Eingabedateien derzeit verarbeitet werden und wie die konsolidierte Ausgabe erstellt wird. Fertig ist die Aufgabe, wenn CSV-Eingaben konsolidiert werden können, ohne dass der Fehler „At least one sheet must be visible“ auftritt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
pandas, python
Bereich
cli, data
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.