[Solved] Set CSV separator and text delimiter when saving

Discuss the spreadsheet application
Post Reply
Geoff Moore
Posts: 4
Joined: Sun May 08, 2016 3:09 pm

[Solved] Set CSV separator and text delimiter when saving

Post by Geoff Moore »

I'm trying to use a Game Maker text engine which reads dialogue from this csv file: https://www.dropbox.com/s/bnflfd3t6uloc ... s.csv?dl=0

When I import it into Open Office and select 'Comma' under Separator Options everything is fairly readable, with other options it's jumbled together. The problem is that commas in dialogue also create a break, which messes up the columns. I need to avoid comma separation.

In the document itself this advice is given: "The .csv files themselves may or not require a different delimiter depending on what text you're using. The default method of delimiting cells is a comma. Naturally, this gets in the way of generic speech which does tend to use rather a lot of commas. I recommend using a vertical bar (ASCII character 124) to delimit cells and a grave accent (character 96) to delimit text. These options are readily adjustable when saving your .csv file (you may need to use Save As in some programs."

I don't know how to set ASCII characters to delimit cells, this is all way over my head. Can someone talk me through how I should be opening/saving the spreadsheet so it is readable and usable? I linked the file up at the top.

Many thanks for reading!
Last edited by Geoff Moore on Mon May 09, 2016 10:56 pm, edited 1 time in total.
Open Office 4.1.1 on Windows 8.1
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Opening a CSV file without using comma breaks

Post by RusselB »

In the Text Import Dialog, there is an option marked Other for the separator. In this location you can enter the character(s) that you want to use as the separator... Multiple characters can be entered.
How you get the correct character into the file initially will depend on the options available from the program that is generating the file.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Geoff Moore
Posts: 4
Joined: Sun May 08, 2016 3:09 pm

Re: Opening a CSV file without using comma breaks

Post by Geoff Moore »

Thanks for replying! So how would I enter an ASCII character in that box?

The file isn't generated by the program, the idea is I make the CSV and the program reads from it. The file I linked is the example that came with the project, so I need to open that in Calc so I can fiddle around with it and see how it works, and I just need to know what calc settings to use to get it to display correctly (i.e. without commas in the dialogue separating the columns). It would be easier to see what I mean if you have time to download the file and open it in calc.
Open Office 4.1.1 on Windows 8.1
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Opening a CSV file without using comma breaks

Post by RusselB »

I did download and open the file, and I can see the difficulties you mention.
Slight misunderstanding.. you want to generate the file using Calc so that the other program can read it, not (as I originally interpreted your post) the other way around.

Any character that is on your keyboard is an ASCII character. I would strongly recommend using a character that is on your keyboard, rather than one that has to be generated using an ASCII character code.
If you insist on using a character that needs to be generated using a character code, then these can be entered using the Alt key and a number sequence entered using the numeric keypad. NOTE: The numbers across the top of your keyboard will NOT work for entering the character code.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
coray80
Volunteer
Posts: 357
Joined: Thu Mar 01, 2012 6:41 am

Re: Opening a CSV file without using comma breaks

Post by coray80 »

Is the attached what you're wanting?
char124 is the shift-backslash on the key board
char96 is the character below the tilde (above the tab key)
Attachments
Geoff Moore.ods
(12.49 KiB) Downloaded 221 times
OpenOffice 4.1.2 on Windows 7
If your question has been answered please add [solved] to the title by using the edit button at your first post
Geoff Moore
Posts: 4
Joined: Sun May 08, 2016 3:09 pm

Re: Opening a CSV file without using comma breaks

Post by Geoff Moore »

@RusselB: I don't mind what characters are used to delimit, as long as it's not something I'm likely to use in dialogue - the reason I mentioned ASCII was because of the quote I posted in the OP from the linked document, I think they're suggesting those characters as they're very unlikely to be used in natural dialogue. I tried entering the ASCII codes and it didn't make any difference anyway - if I select anything other than comma it's all jumbled together. When you opened the document, were you able to set it so you could view unbroken stretches of text?

@coray80: When I open that file it still has column breaks where the commas fall in the dialogue, so it seems it's still separated by commas.

For example, B13 and C13's contents should just be in B13, but because of the comma in the sentence it's pushing it onto the next column. I need everything neatly in columns, but not separated by commas, if that makes sense.
Open Office 4.1.1 on Windows 8.1
User avatar
MrProgrammer
Moderator
Posts: 5428
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Opening a CSV file without using comma breaks

Post by MrProgrammer »

Hi, and welcome to the forum.
Geoff Moore wrote:In the document itself this advice is given: "… I recommend using a vertical bar (ASCII character 124) to delimit cells and a grave accent (character 96) to delimit text. These options are readily adjustable when saving your .csv file (you may need to use Save As in some programs."
I don't know how to set ASCII characters to delimit cells, this is all way over my head. Can someone talk me through how I should be opening/saving the spreadsheet so it is readable and usable?
That advice means: use File → Save As → File type → Text CSV → ✓ Automatic file name extension → ✓ Edit filter settings → Save → Character set → Unicode → Field delimiter → | → Text delimiter → `→ ✓ Save cell content as shown → OK. For the field/text delimiters, do not use the dropdown arrows to select standard characters; just type the | and ` in the dialog boxes.
Screen Shot 2016-05-08 at 22.47.07 .jpg
Note the recommended text delimiter is ` and not '.  After you've saved the CSV file with these delimiters, you'll need to specify them again when you import it into Calc or into another program like "Game Maker text engine".

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Geoff Moore
Posts: 4
Joined: Sun May 08, 2016 3:09 pm

Re: Opening a CSV file without using comma breaks

Post by Geoff Moore »

Thanks everyone! It turned out I needed to set " as the text delimiter when importing, everything displays correctly that way.
Open Office 4.1.1 on Windows 8.1
Post Reply