Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export TXT replaces newline character #2811

Open
tlegrave opened this issue Jul 30, 2024 · 4 comments
Open

Export TXT replaces newline character #2811

tlegrave opened this issue Jul 30, 2024 · 4 comments
Labels

Comments

@tlegrave
Copy link

Hello there,

Describe the bug
When I make a txt export from the UI with utf-8 encoding, newline characters are not respected.

To Reproduce
Steps to reproduce the behavior:

  1. Connect Trino data source
  2. Enter the following query SELECT concat('Hello', CHR(10), 'world') AS result;
  3. Click export, choose txt and set all field to false
  4. Choose utf-8 encoding and download the file

Screenshots
Capture d’écran 2024-07-30 à 10 08 21

Value in the bottom-right panel looks good but after download the file contains:

Hello¶world

Desktop (please complete the following information):

  • OS: OS X 12.7.3
  • Browser Firefox
  • Version 128.0.3

Additional information

  • Other ascii code points seem to be respected (e.g. space)
  • Other non ascii code points seem to be respected (e.g. à)
  • Zero width chars (e.g. combining characters) work and are not modified by the export function

Is this a bug or a desired behavior? If this is wanted, is there any plan to add a "raw" export feature?

Thanks

@tlegrave tlegrave added bug Something isn't working wait for review labels Jul 30, 2024
@dariamarutkina
Copy link
Contributor

@tlegrave thank you for bug reporting!
We are going to fix it in the near future.

@dariamarutkina dariamarutkina added this to the 24.2.4 milestone Jul 31, 2024
@LonwoLonwo
Copy link
Member

Hello @tlegrave

We reviewed your request again, and we have a question now.
Why do you need a new line inside a value in the result text? Our TXT export format is designed to have all values from the row in a single string. A new line character will break this behavior. Maybe you can just use the \n symbol instead of the CHR(10)? In this case, you can copy content from your .txt file with a new line inside.

@tlegrave
Copy link
Author

Hello @LonwoLonwo,

Sorry for the late reply. The usecase was a bit tricky, I wanted to format the output of the query to make it compatible with SRT subtitle files (the tables stores transcriptions of videos).

Using a \n instead of CHR(10) does not solves the problem as it prints a raw \n in the export. For example:

Hello\nworld

I didn't know that txt export was designed to handle all values on a single line. I understood it more like a "raw" export of the data (doesn't matter linebreaks or other stuffs).

@LonwoLonwo
Copy link
Member

I am not sure what we can do inside our one-line .txt export.
Did you try to use the XLSX export? And rework the .xlsx file in the required format?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants