Open henritielscher opened 4 months ago
I've written some small script which worked out:
import fs from "fs";
import csvParser from "csv-parser";
type TextObject = {
Count: string;
Name: string;
Edition: string;
"Collector Number": string;
Foil?: string;
};
let text: TextObject[] = [];
fs.createReadStream("./data.csv")
.pipe(csvParser())
.on("data", (data) => {
text.push(data);
})
.on("close", () => {
text.forEach((object) => {
const {
"Collector Number": Number,
Count,
Edition,
Name,
Foil,
} = object;
console.log(
`${Count} ${Name} (${Edition.toUpperCase()}) ${Number} ${
Foil ? "*F*" : ""
}`
);
});
});
Sorry forgot to mention, that I used your CSV to transfer it back to text. I think doing a text download button should be a piece of cake using your Dataset and the logic of DownloadButton.js to simply put out a blob as txt file separating by lines. Thanks again. I already saved so much time :D
Hey there, first of all. Awesome tool! For my purpose it would be absolutely great to have a txt-file export as well, since I track all drafts via decks, which I then add to the collection. Unfortunately the deck builder on moxfield does not support importing csv-files. I'm programming myself, mostly in React / Typescript, if you need any help implementing that... Best, Henri