Datasets:
Download source/tests/solvers/tx_fixedwidth.py from Syndicate604/skills-desk: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/datasets/Syndicate604/skills-desk/resolve/main/source/tests/solvers/tx_fixedwidth.py
- Command line
-
hf download hf://datasets/Syndicate604/skills-desk/source/tests/solvers/tx_fixedwidth.py
-
curl -L -o tx_fixedwidth.py https://huggingface.co/datasets/Syndicate604/skills-desk/resolve/main/source/tests/solvers/tx_fixedwidth.py
417 Bytes
| import csv | |
| w = csv.writer(open("accounts.csv", "w", newline="")); w.writerow(["account", "name", "balance", "opened"]) | |
| for line in open("listing.txt"): | |
| if not line[:8].strip().isdigit(): continue | |
| b = line[30:42].strip(); neg = b.endswith("-"); b = float(b.rstrip("-").replace(",", "")) | |
| d = line[42:50] | |
| w.writerow([line[:8], line[8:30].strip(), f"{-b if neg else b:.2f}", f"{d[:4]}-{d[4:6]}-{d[6:]}"]) | |