Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^3: Bug in script when users use long names

by boftx (Deacon)
on Sep 25, 2013 at 04:47 UTC ( #1055604=note: print w/replies, xml ) Need Help??

in reply to Re^2: Bug in script when users use long names
in thread Bug in script when users use long names

Looking at this further I notice that there doesn't appear to be any kind of format version number in the header info. Shame on your source for that. But even so, it appears to a simple matter to just check to see if the Date/Time header is present in the first header line and if not you know you are dealing with (what I presume is) the newer data format.

On a side note, this kind of data format has been largely replaced by XML for B2B data exchange. Some vendors have opted for a CSV format, but it is just simply amazing to see how many programmers can not generate a proper CSV file, or an XML file for that matter. There is still something to be said for a fixed length record after all. :)

On time, cheap, compliant with final specs. Pick two.
  • Comment on Re^3: Bug in script when users use long names

Replies are listed 'Best First'.
Re^4: Bug in script when users use long names
by soonix (Monsignor) on Sep 25, 2013 at 09:42 UTC

    To me, it looks more like both are the same, just the "Name" column wider, and the line breaks inserted by some tool, that makes it more human readable but more difficult for automatic processes (my guess is Windows, perhaps Powershell?)

    Sparky: perhaps your source can output CSV or XML or something better parseable?

    Otherwise, you could record the position (line/column) of the relevant column header ("Creation Date/Time") and follow boftx's advice.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055604]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2018-05-25 03:35 GMT
Find Nodes?
    Voting Booth?