I’m exporting CSV’s from Airtable and have introduced some fields which represent HTML code. This data is imported into wordpress blocks. I need to use commas in the text.
Here’s an example:
''&'<p style="text-align: center;">For a local, reliable & friendly service call our <strong>'&Locality&'</strong> hotline today</p>'
In this example the software that parses the CSV delimits the data on the , after the word “local” as you might expect (even when enclosed by quotes).
No problem, I’ll use the unicode version of “,” which is
, and then the commas won’t exist in teh output but will still show correctly when output as HTML …
… but no, Airtable does an outstanding job and converts the unicode to a “,” and outputs it in the CSV as a “,” :frowning: It also does the same thing with #comma and other variants I’ve tried.
Does anybody know of a way of preventing Airtable from “helpfully” changing these codes? Any way of “escaping” them?
This is software outside of Airtable trying to parse the CSV generated by Airtable, right? What software are you using to parse the CSV?
Most people think that there is only one standard for encoding data in CSV format, but there isn’t. There also is variability in how different software parses CSV data. In my experience, Airtable takes a reasonable approach to encoding commas, quotes, and new line characters CSV.
Can you use different software to parse the CSV data?
Its a plugin with an import function and it doesn’t seem to ignore commas within quotes, it just sees a comma and splits the record. There is no alternative. The delimiter it is looking for can be changed from a comma, but Airtable cannot export using a different delimiter. Workable in so far as I could open the csv and re-export from excel using the alt delimiter , but its a lot of messing about as this isn’t a one off operation. I’m importing/exporting csv’s dozens of times a day.
If I have to, I’ll simply not include commas as punctuation in the text, it won’t matter too much.
My question was more that when I have the unicode text saved in an Airtable field and then export to csv, Airtable doesn’t export it as-is, rather it converts that text to a comma and then outputs that. Not helpful in many instances as there may be many other characters I may wish to represent with unicode validly , that Airtable is going to convert. I wondered if there was a way of escaping a sequence of characters so that Airtable would just export the text exactly as typed and not convert it back to ASCII.
You could contact the author if the Wordpress plugin with the issue and see if there is an update that fixes the issue.
That’s a lot of manual importing/exporting. There must be a way to automate this.
What about using scripting to create the CSV with a custom delimiter? Or using scripting to push the info to WordPress directly without messing with the plugin?
What about a third party service that exports to CSV with a custom delimiter?
Or is budget a limiting factor?
I understand that you are facing issues with Airtable converting the Unicode version of commas to actual commas in CSV files. This can be frustrating, but there are a few workarounds that you can try.
One way to prevent Airtable from converting the Unicode version of commas is to use a different delimiter in your CSV file. For example, you can use a pipe (|) or a tab (\t) as a delimiter instead of a comma. Your HTML code will be safeguarded from any impact caused by the conversion.
Another way to escape the commas is to use double quotes around the fields that contain HTML code. This will ensure that the commas are treated as part of the field and not as a delimiter. For example, you can modify your example as follows:
‘’&‘<p style=“text-align: center;”>For a local, reliable & friendly service call our <strong>’&Locality&‘</strong> hotline today</p>’’
Note the double quotes around the entire field. This will ensure that the commas are not converted to actual commas in the CSV file.
In terms of selling software development services, it’s important to have a clear understanding of your target market and their needs. According to a recent report on Software Development Services Market: Key Strategies For Effective Selling, effective selling strategies can help you reach a wider audience and build relationships with potential customers.