in reply to Re: Re: Convert a Tab-Delimeted File to XML
in thread Convert a Tab-Delimeted File to XML

Good point - personally, i hate tab-delimited files. If my labels can contain whitespace, then i will use something like a colon or a semi-colon or maby even -=:TOMMY_LEE:=-

i think merlyn chose \s+ to take care of situations where tabs and spaces could be inter-mixed.

it all boils down to TIMTOWTDI ;)

jeffa

  • Comment on (jeffa) 3Re: Convert a Tab-Delimeted File to XML

Replies are listed 'Best First'.
Re: (jeffa) 3Re: Convert a Tab-Delimeted File to XML
by Anonymous Monk on Sep 30, 2001 at 12:57 UTC
    My comment would have broken merlyns code and I feel I should post an apology. A split on \t would have left @values with an extra linefeed, so to be able to handle a proper tab-separated header you also need to:
    chomp $labels[-1]
    after splitting on \t. If the header is really one-or-more-whitespace-characters-separated, then the original code is fine. Feel free to mod me down or take experience points or whatever is the punishment du jour :-)
Re: (jeffa) 3Re: Convert a Tab-Delimeted File to XML
by maverick (Curate) on Oct 02, 2001 at 02:25 UTC
    Naw man... *NIKKI SIXX* is a much better delimiter.

    /\/\averick