-
Suggestion
-
Resolution: Obsolete
-
Medium
-
None
-
None
-
None
Due to changes in CSV parser a backslash became a special character.
If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote. In case it does the following character will be kept but the first backslash will be omitted.
Both JIM and JIRA are affected. Probably worth mentioning somewhere?
[JIM-596] Backslash in now a special character in CSV (JIM and JIRA specific)
Giles, this issue is no longer valid. Roy decided we switch back to the good, old one CSV parser (https://studio.atlassian.com/browse/JIM-642) so if you did any changes to the documentation please rollback them.
@Roy, as you can see the parse does strange things in some cases. I think we should fix it.
I updated Giles comment with an exact output created by the importer.
Hi Pawel / Wojtek,
Thanks Pawel for your explanation above, but unfortunately I'm still none the wiser. Perhaps it's just me but are you able to complete the following table of examples and I'll work out an explanation to describe this change in CSV parsing behaviour in our docco:
In CSV file (i.e. the input file) | What JIRA's new CSV parser converts this to: |
---|---|
C:\Program Files | C:rogram Files |
C:\\Program Files | C:Program Files |
'C:\Program Files' | 'C:rogram Files' |
'C:\\Program Files' | 'C:Program Files' |
"C:\Program Files" | C:rogram Files |
"C:\\Program Files" | C:\Program Files |
C:'\'Program Files | C:'Program Files |
C:'\\'Program Files | C:''Program Files |
C:"\"Program Files | Invalid line, there's an opening double-quote without a closing one. |
C:"\\"Program Files | C:\"Program Files |
As you can see in the left column above, if you need to display two backslashes inside JIRA comments (i.e. without JIRA interpreting this as a 'new line' character), insert
‌
between the two backslashes, that is...
\‌\
Ad. 1) Single quotes are not treated any special way. The sentence is valid for double quotes.
Ad. 2) If you have a single line of text and it's not in double quotes you need to put
C:\Program Files
, but if it's in double quotes you need to use
"C:\\Program Files"
.
Hi Wojtek,
Not just yet, because the following explanation is not entirely clear...
If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote. In case it does the following character will be kept but the first backslash will be omitted.
Could we please clarify this statement? ...
If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote.
- When you say '...found inside quoted text...' do you mean single quotes or double quotes - or does this not matter? In other words...
- "Go to C:\Program Files" will result in "Go to C:Program Files"
OR - 'Go to C:\Program Files' will result in 'Go to C:Program Files'
- "Go to C:\Program Files" will result in "Go to C:Program Files"
- When you say '...unless it precedes another backslash or a double quote...' do you mean that to end up with a backslash in the results, you need to have one of the following in your CSV file...
- C:\\Program Files
OR - C:"\"Program Files
- C:\\Program Files
Could you please specify some examples of what a customer requires in their CSV input file to get a backslash imported into JIRA?
Please remind me which version of JIRA this effects, 4.4.1 ? or 4.4.2?
in JIRA only Jelly. Additionally Paul mentioned that CSV library is used in Studio for something. At the moment Studio still uses mindprod so it's unaffected yet.
wojtek,
where in JIRA is this effected? mainly jelly importing if i recall from our meeting... anywhere else?
this effects JIM 3.3+ correct?
and yes, let's consider fixing this because if we dont then i assume that means anyone wanting to import an issue with a backslash will need to manually edit their csv file?
This problem is actually even bigger, because popular programs saving files in CSV format (like Open Office or Excel) do not escape backslashes ("\") (I've just tested it with Open Office to be 100% sure) - so cells including backslashes will be saved to CSV in the format which now neither JIRA nor JIM parses correctly.
That's BAD.
IMO Open Office, Excel, etc. - are one of the primary sources of CSV files we handle.
So:
- we definitely should mention that somewhere in CSV doco for JIM (in a clear place)
- we should mention it in JIRA doco (4.4.1+)
- we should really consider fixing this problem (even when it means forking opencsv library which we now use) in the next releases.
First to items I believe are up to Giles, whereas the last one is up to Roy. I'll ping him once again.
Just to be clear, this is for JIRA 4.4.4 onwards.