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

Comma in a string field #8

Open
dosimont opened this issue Mar 3, 2015 · 3 comments
Open

Comma in a string field #8

dosimont opened this issue Mar 3, 2015 · 3 comments
Assignees
Labels

Comments

@dosimont
Copy link
Collaborator

dosimont commented Mar 3, 2015

Example:

[...]
%EventDef PajeStartLink 40
% Time date
% Type string
% Container string
% StartContainer string
% Value string
% Key string
%EndEventDef
%EventDef PajeEndLink 41
% Time date
% Type string
% Container string
% EndContainer string
% Value string
% Key string
%EndEventDef
[...]
41 3.772031 "L_MPI_Coll" "C_Prog" "P#1_T#3626231744" "src=0, dest=1" "0_1_0x7f0df00f6390"
[...]
40 3.775296 "L_MPI_Coll" "C_Prog" "P#0_T#2910222272" "src=0, dest=1" "0_1_0x7f0df00f6390"

leads to this pjdumped output:

Link, Program, MPI collective communication, 3.7753, 3.77203, -0.003265, src=0, dest=1, P#0_T#2910222272, P#1_T#3626231744

where container fields are shifted of +1 because of the additional comma,

I see two solutions:

  • the simplest : forbid commas in string and raise an error if a comma is present in the trace
  • use " or ' in the output around the problematic string. However, according to the program that reads the csv, it could still be a problem to have a comma in the string.
@schnorr
Copy link
Owner

schnorr commented Mar 3, 2015

Can you provide a small but complete trace file so I can reproduce the error? Between the two solutions you mentioned, I'd favor the simplest one (forbid commas in strings), but wouldn't that be too much strict?

@dosimont
Copy link
Collaborator Author

dosimont commented Mar 3, 2015

I think it is preferable to be reliable/stable even if it implies to be strict. But it is just my opinion ;-)

@vdanjean
Copy link
Collaborator

vdanjean commented Mar 3, 2015

Csv files can quote comma. There are several ways to do this. I think the best thing to do is to look at csv documentation and choose a well-used way to quote comma, simple and double quote.
It might be more tricky (and probably far less supported in csv readers) to handle return line in csv fields. Fot this, I think we can forbid them.

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

3 participants