From your question I can't tell if you want to determine the delimiter from an existing csv so you can parse it correctly or simply allow the user to choose a delimiter and do a search replace across the file.

As far as determining the delimiter in an existing file you may want to prompt the user to select a delimiter. Giving them your best guess as well as showing them the first few lines of the file would probably be a good idea. You might even go so far as to show them where the fields would break based on their currently selected delimiter.

Replacing the delimiter could be tricky since delimiters are often chosen based avoiding characters that are likely to appear in the data.


In reply to Re: what type of deliminator is used in tabular file. by n8g
in thread what type of deliminator is used in tabular file. by wst

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.