#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    2
    Rep Power
    0

    Validate CSV Row


    I have multiple rows in a comma delimited CSV file with no text qualifier. What I need to do is validate rows that contain a digit value in field/column 15. Any help is appreciated, thanks in advance. Any value can be in in of the previous fields 1 - 14, but 15 will only be populated with a digit when that line is needed.

    Example would be
    Match
    ,,,,,,,,,,,,,BK,7,,,9/20/2011,2/7/2012,
    No Match
    ,,,,,,,,,,,,,BK,,,,,,,,,,,,,,,,,,,,,,,,,,
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,007
    Rep Power
    9398
    If you know that the only commas will be field delimiters then
    Code:
    /^([^,]*,){14}\d+,/
    Otherwise it might be easier to validate it in the code.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    2
    Rep Power
    0
    That worked, thanks a ton!!!

IMN logo majestic logo threadwatch logo seochat tools logo