Results 1 to 3 of 3

Thread: Splitting with comma

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Posts
    20

    Splitting with comma

    Hey guys,

    I need to do a split in an old app we've got running and it's in classic ASP. We're importing some stuff into a database and running through a report file.

    The report file is comma delimited. Now here is the problem I've got:

    Date Range,"Jul 14, 2010"

    This get's split by the comma but it splits the date up as well. Now we do have the "" around the date. Is there a way to tell Split or use a different function to ignore splitting anything that is inside a ""

    Thanks for your help.
    AdoSoft INC
    A Software Development Company

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Splitting with comma

    Use Regular Expressions.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3
    Addicted Member
    Join Date
    Jul 2009
    Posts
    208

    Re: Splitting with comma

    Use Split, then concatenate the date parts:
    parts = Split(yourString,",")
    theDate = parts(1) & parts(2)

    Use string functions if you need to remove the quotes from theDate string.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width