|
Post by fzghoul on Feb 15, 2021 20:39:56 GMT
Sorry, my skills are pretty rudimentary so I am making some silly errors...
I'm trying to export a freeform text field (among other fields) to CSV. I have to strip out line breaks, so I'm using the replace function. It works, but all the apostrophes ( ' ) are showing as "’" I do not know if this is a characteristic of CSVs or if I'm using the replace function incorrectly. For what it is worth, I also convert another field to text and the apostrophes come over without issue, I am not using the replace function for that field.
Here is the replacement text.
replace(match: "," , replace: ";" , replace(match: "\n" , replace: " * " , to_text(card.rules)))
Bonus question while I'm working on this... rather than write to a file, is there a way for export to append onto an existing file?
Many thanks!
|
|
|
Post by fzghoul on Feb 25, 2021 1:36:23 GMT
Sorry for the bump - Slowly resolved a couple of other issues I was working through on the export template. I'm still a little baffled by why the apostrophes are coming over so awkwardly. I haven't solved the append item yet either, but that's not as big of a deal as I only have 30'ish files to combine. It's more of a long term configuration control concern.
|
|
|
Post by arcmaster on Mar 1, 2021 6:09:16 GMT
Sorry to ask here and my question is not on the subject. Is there an area where you can request to add a new Template from another card game?
|
|
|
Post by cajun on Mar 2, 2021 6:07:31 GMT
but all the apostrophes ( ' ) are showing as "’" this looks like an encoding error. are you sure you're using ' and not the curly apostrophe ’ ? if you're using that, replacing to normal ' would probably help. if not, make sure you're opening the files on a utf-8 reader i guess?
the appending is.... kind of possible but probably not helpful. you can't load in the text file, but you could save it as a variable in a different file.
file_to_append
initial_string := "some kind of string"
export_template include file: file_to_append
for each card in cards do initial_string := initial_string + "whatever you're appending"
that's annoying but not impossible to do if you need linebreaks, and you'd have to edit the variable on file_to_append each time still
|
|
|
Post by fzghoul on Mar 23, 2021 3:24:36 GMT
Sorry for the late reply cajun... life with a kid...
I'll need to check on the apostrophe. I thought I was doing regular, but the font shows up as curly on the cards... so...
I'm not quite sure I understand the instructions you provided. Are you essentially saying, make a file, then import that file into the export?
I did discover another way to accomplish the task outside of MSE. If anyone finds this thread via search in the long, forlorn future: Open up command line in administrator mode Go to the directory you intend to compile Use the function: copy *.csv FILENAME.csv
So I just export my files into a single directory, then run that via command prompt and get a nice combined file.
|
|