Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    delimiter characters in data files (Word 2002 XP SR3)

    A system (Lotus Notes database) does an export of data and generates ini file. This .ini file is used by Word to obtain employee data.

    In the ini file the seperator used is the bar "|".

    The code reads the ini file, and for each record, if a bar is in the record string, it seperates the data into the next field

    ...fairly straight forward stuff right...

    so in the notes system for the Department field, for one of the departments names someone had added a comma ","

    now when reading the ini file, the comma is detected as a seperator, and throws out the record dataset.

    by the results its obvious that its read the comma as a delimiter /seperator.

    Why would it do that? is it just not that smart enough therefore any default characters used as delimiters will effect the data.

    The default delimitars are Tab, Semicolon, Comma, Space and other...


    diana
    Attached Images Attached Images

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: delimiter characters in data files (Word 2002

    Do you have access to the code? Without reading the code, it's very difficult to answer the question of why it is using the comma as a delimiter.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: delimiter characters in data files (Word 2002

    ive attached the code...

    in the code the seperator character is the bar...there is no other reference to any other delimiters...

    iBarThisPos = InStr(iBarLastPos + 1, sStaffRecord, "|")


    heres some sample data from the ini file...

    with old department name...the dept name being "Intellectual Property & Technology"

    Stern||Stephen|3213|Melbourne|Intellectual Property & Technology|||Partner|SMS|stephen.stern@corrs.com.a u|03 9672 3213| 11208

    with new department name with comma character...
    the dept name being "Intellectual Property, Information Technology & Competition"

    Stern||Stephen|3213|Melbourne|Intellectual Property, Information Technology & Competition|||Partner|SMS|stephen.stern@corrs.com. au|03 9672 3213| 11208


    diana
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: delimiter characters in data files (Word 2002

    The Input statement assumes that a line consists of comma-separated variables. To read the entire line, you must use Line Input instead of Input: change both instances of

    Input #iFileNum, sStaffRecord

    to

    Line Input #iFileNum, sStaffRecord

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: delimiter characters in data files (Word 2002

    thanks Hans

    i didnot know that...i learnt something new

    thanks again Hans

    diana

Posting Permissions

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