Alpha DevCon 2018
Results 1 to 3 of 3

Thread: Programming Puzzle 19 - Import Madness #3

  1. #1
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,300

    Default Programming Puzzle 19 - Import Madness #3

    Your manager is impressed with how well you're getting on. She has another "little project" for you.

    Modifying Imported Data

    The data imported in Import_Madness 1 needs to be corrected before we can do a mass mailing.

    The original data was submitted as a mix of upper case and lower case values.
    The lower case characters need to be converted into upper case.

    Punctuation was also included in the import. All puncuation characters need to be removed.

    For example
    Before: 21 Porter St.
    After: 21 PORTER ST

    Also an error was made during the intial field size generation.
    The Zip code needs to be resized to handle 15 characters.

    Your assignment, grasshopper, is to write an xbasic script that will process the original CSV text file, importing the field values into a table, while at the same time cleaning up the data, as described above.

    Post your solution using an "exported" version of your script. As before, please prefix your script name with your initials.

    Good luck, and have fun.

    -- tom

    PS - Thanks again to Andy Schone for this puzzle.

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,300

    Default Re: Programming Puzzle 19 - Import Madness #3

    Here's my solution.

    Are there better approaches?

    -- tom

  3. #3
    "Certified" Alphaholic
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    1,044

    Default Re: Programming Puzzle 19 - Import Madness #3

    I originally wanted to force the capitalization via field rules. Even had the rules editing portion of the script completed. Only problem was when I was writing the data to the table via <tbl>.enter_begin(.t.) the capitalization field rule was not being enforced. So with shame I hang my head and use a different approach.
    Attached Files Attached Files

Similar Threads

  1. Programming Puzzle 3 - Fractions, anyone?
    By Tom Cone Jr in forum Xbasic Programming Puzzles
    Replies: 7
    Last Post: 11-08-2011, 05:40 AM
  2. Programming Puzzle 11 - More Loops
    By Tom Cone Jr in forum Xbasic Programming Puzzles
    Replies: 11
    Last Post: 08-20-2011, 04:50 PM
  3. Programming Puzzle 17 - Import Madness #1
    By Tom Cone Jr in forum Xbasic Programming Puzzles
    Replies: 7
    Last Post: 08-17-2011, 08:49 PM
  4. Programming Puzzle 7 - Yet another nested loop!
    By Tom Cone Jr in forum Xbasic Programming Puzzles
    Replies: 4
    Last Post: 08-08-2011, 05:41 PM
  5. Programming Puzzle 18 - Import Madness #2
    By Tom Cone Jr in forum Xbasic Programming Puzzles
    Replies: 7
    Last Post: 07-25-2011, 03:45 PM

Bookmarks

Posting Permissions

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