Menu

#2 some fileds are not parsed properly

pending
5
2013-08-09
2013-05-14
Oleg Mezhov
No

351 line of csvdiff_function.pm, parse_line function
You could have set the negative LIMIT for split function.

@a_data = split(/\Q$s_delimiter\E/x, $s_data,-1);
Otherwise some filed might be parsed incorrectly, that is especially important for keys!

Function reference:
If LIMIT is negative, it is treated as if it were instead arbitrarily large; as many fields as possible are produced.
If LIMIT is omitted (or, equivalently, zero), then it is usually treated as if it were instead negative but with the exception that trailing empty fields are stripped (empty leading fields are always preserved); if all fields are empty, then all fields are considered to be trailing (and are thus stripped in this case). Thus, the following:
print join(':', split(',', 'a,b,c,,,')), "\n";
produces the output 'a:b:c', but the following:
print join(':', split(',', 'a,b,c,,,', -1)), "\n";
produces the output 'a:b:c:::'.

Discussion

  • Roland Schmitz

    Roland Schmitz - 2013-05-16
    • status: open --> pending
     
  • Willem Weide

    Willem Weide - 2013-08-09

    The problem is solved in the last update
    (Changeset > 164:d14dfdaecce4)
    Thanks for your contribution.

     

    Last edit: Willem Weide 2013-08-09

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.