#12482 closed defect (cantfix)
Trac tab-delimited Export
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | report system | Version: | |
Severity: | normal | Keywords: | tsv |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I am trying to export my trac tickets-change history with following SQL-Query:
SELECT DISTINCT t.id AS Ticket, t.description as Description, group_concat ( tc.author, '; ') AS Author, group_concat ( tc.field, '; ') AS Field /*group_concat ( tc.oldvalue, '; ') AS Comments_Old */ group_concat ( tc.newvalue, '; ') AS Comments_New FROM ticket t LEFT JOIN ticket_change tc ON ( t.id=tc.ticket ) GROUP BY t.id, t.summary
Problem is that he puts a linebreak at the field 'Comments_New' like seen on the screenshot
Attachments (1)
Change History (8)
by , 9 years ago
Attachment: | problemstack.png added |
---|
comment:1 by , 9 years ago
Component: | general → report system |
---|---|
Description: | modified (diff) |
Keywords: | tsv added; Trac trac-import SQL-Query Sql tab-delimated import linebreak cr lf removed |
Priority: | highest → normal |
comment:2 by , 9 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:3 by , 9 years ago
ok thank you very much for your quick answer.
I am new to trac, so can I integrate the double-quotes to my SQL-Query?
comment:4 by , 9 years ago
I replaced my single quotes with double quotes but it didn't worked, there are still newlines
comment:5 by , 9 years ago
No, no. The tsv format allows that newlines can be contained in each field.
comment:6 by , 9 years ago
Resolution: | worksforme → cantfix |
---|
If you dislike newlines in your tsv export, you can use REPLACE()
function to remove newlines.
- MySQL
-
GROUP_CONCAT(REPLACE(tc.newvalue, '\n', ''), '; ') AS Comments_New
- SQLite
-
GROUP_CONCAT(REPLACE(tc.newvalue, CHAR(10), ''), '; ') AS Comments_New
InstallationIssue. Support and installation questions should be asked on the mailing list or IRC channel.
comment:7 by , 9 years ago
Thank you i tried your suggestion, we use MySQL, but the line breaks are still there it didn't worked..
Not a bug.
The newlines can be contained using double-quotes.