Here is a suggestion from https://discussions.apple.com/message/26532955#26532955
Answer from Ruskes on Stack ExchangeIn order to import comma-separated CSV into Numbers.app properly, you need to set the decimal separator to period in System Preferences. If decimal separator is set to comma, Numbers.app can only import semicolon-separated CSV.
- Quit Numbers.app;
- Set the decimal separator to period, temporarily, in System Preferences; [/Language & Region/Advanced]
- Launch Numbers.app, import the CSV file and save the resultant Numbers file;
- Quit Numbers.app;
- Reset the decimal separator to the original (presumably, comma) in System Preferences;
Is there a way to add commas to numbers that are put in alerts by variables? For example if I set variable x to pick a random number 1-100K would there be a way to make the random number show up in the alert with a comma in it?
Videos
Does anyone know how to get the decimal comma on the Apple Mac NUMERIC keypad? I've looked and talked to customer support and still cannot get it to work. They have suggested changing the language which isn't going to work as other languages use the AZERTY layout. there should be a software option that any input on the numeric keypad to enter the decimal marker inserts your desired dot or comma.
Here is a suggestion from https://discussions.apple.com/message/26532955#26532955
In order to import comma-separated CSV into Numbers.app properly, you need to set the decimal separator to period in System Preferences. If decimal separator is set to comma, Numbers.app can only import semicolon-separated CSV.
- Quit Numbers.app;
- Set the decimal separator to period, temporarily, in System Preferences; [/Language & Region/Advanced]
- Launch Numbers.app, import the CSV file and save the resultant Numbers file;
- Quit Numbers.app;
- Reset the decimal separator to the original (presumably, comma) in System Preferences;
CSV files are just plain text files; you could use something like BBEdit to edit, search, replace and then save the file.
In CSV you can also encapsulate values in between " So your CSV file should in fact look like: "Address 1","Address 2","Address 3" please note: no space after the coma and before the opening double-quote.
Bonus: while editing your CSV, you can also use the vertical editing mode in OS X: press option key and click-drag-vertically to select a column of text. Once the column selected you can start typing: it will write what you type on all the lines. It's like magic!
However, by experience, I would advise you to get to the source of the CSV file and make it use the double quote.
Hope this helps! Good luck!
You can use a handy feature called AppleScript's text item delimiters, which allows you to break up (or "parse" in computer jargon) text into segments, and then extract data from those segments. They are the separators of text items in a piece of text. A simple example:
set prevTIDs to AppleScript's text item delimiters
set theString to "Don't-eat-the-yellow-snow"
set AppleScript's text item delimiters to "-" --tell AppleScript to break up strings at each occurrence of a hyphen '-' in a given string
set these_items to every text item of theString
//--> {"Don't", "eat", "the", "yellow", "snow"}
set AppleScript's text item delimiters to prevTIDs
return these_items
It is always considered good practice when working with text item delimiters to restore the original delimiters; once you change the delimiters, they will globally affect the running environment until the process is closed and restarted.
Another use for text item delimiters is replacing words or characters in a given string:
set prevTIDs to AppleScript's text item delimiters
set theString to "Don't eat the yellow snow"
set AppleScript's text item delimiters to "yellow" --the word you want to replace
set temp to every text item of theString
//--> {"Don't eat the", "snow"}
set AppleScript's text item delimiters to "pink" --the replacement word
set theString to temp as string
set AppleScript's text item delimiters to prevTIDs
return theString
//--> "Don't eat the pink snow"
However, note that this replaces every occurrence of the word "yellow". The reason I'm saying this is consider the following string:
If someone added one plus one, what would be the result?
If you wanted to replace the word "one" with the word "two", you would have to be sure to precede "two" with a space when creating the new delimiter, or your resulting string would be the following:
If sometwo added two plus two, what would be the result?
What you're trying to do is basically replacing empty strings with commas. All you need to do is follow these simple steps to do this:
- Create a variable to store the current delimiters in
- Create a variable to store your string in
- Change the delimiter to an empty string
"" - Coerce your string into a list (i.e.
set the list to every text item of yourString) - Change the delimiter to a comma
, - Coerce your newly created list back into a string (i.e.
set yourString to list as string) - Restore the old delimiters
returnyour string
The resulting code:
set prevTIDs to AppleScript's text item delimtiers
set myString to "0123456789"
set AppleScript's text item delimiters to ""
set the_list to every text item of myString
set AppleScript's text item delimiters to ","
set myString to the_list as string
set AppleScript's text item delimiters to prevTIDs
return myString
Happy coding! :)
Something like this?
set theNumber to "3452678190"
set AppleScript's text item delimiters to ","
set theItems to every character of theNumber as string
set AppleScript's text item delimiters to ""
return theItems
I had set dot instead of comma as separator in number format. After updating to macOS Ventura, numbers in apps now show commas again. How can I set up a German language with number format separator dot instead of comma?