How to Clean up USCF Cross Tables
by Mark Kaprielian, Web Master
08-09-2002

This page describes how to "clean up" the file you receive from the USCF to make it look much more presentable.

What your about to read looks very tedious and perhaps difficult.  Because I know the steps well and have had practice, I can take the raw file and create all the cleaned versions in literally, less than 5 minutes.  (sometimes 10 if I'm off and mess it up)

The file you receive from the was created by what I believe is a 1970s era FoxPro database.   It is in Line Printer format.  This means that when you open it up, you will see lots of weird looking characters and some squares that represent non-printable characters.

Usually, when it is sent, there is no file extension in the name of the file.

Step 1
  Rename the file to have the .txt extension and give it a name that looks something like the following:
      2002-08-08_USCF_Raw.txt
  This would be the date you received it and denotes it is the "Raw" or unprocessed version of the file.
Step 2
  Make a copy of the file and call it   
    2002-08-08_USCF_Cleaned.txt   
 
This denotes that it is the cleaned version of the very same file.  By making a copy, you have the original to go back and start over with in the event you mess up the cleaning process.       
  Here is a link for you to download a copy of a file, as sent from the USCF. 
     Practice_USCF_File.txt
  NOTE:  If someone opens the file in another program and then saves it, (this includes Word), you will not be able to clean it up.    Programs deal with the weird characters differently and what you open will not be what you get later.  You have to insist on an un-opned file.  I tell organizers who send me files for posting to the site to not even bother to look at the file, just forward it to me.
  I used to use Word to do Find and Replaces of all the weird stuff.   This was very tedious and very difficult because of the multiple ways Word can read in, translate on the read in, and translate on the writing back out.  I made it work but it was nasty.
   I highly recommend you use a Text editing program.  Not all will handle the odd characters though.   I highly recommend you get a FREE program that I came across that does the job very nicely.  It is called   EditPadLite.   I actually purchased the Pro package but have used the Lite, free version a lot as well.  The program works very well and is pretty much bug free.   I make great use of it for a lot of things.  Here is where you can find it.
    http://www.editpadpro.com/ 
  On the left edge of the page , look for the link for   EditPad Lite
  Once you use this, you'll never want to use Note Pad that comes with windows again.  Right off the bat, its better because it lets you open multiple document at the same time.
Step 3  
  Open up the copy of the file you called Cleaned (which we haven't cleaned yet)
Step 4  
  Using the short cut   ctl-F (hold the control key and press F key.  It does not have to be a capital F) open up the Find and replace window.
  Set up the search criteria check boxes as follows:
 
Check         Start from beginning
Check         Case sensitive
Uncheck     all other options
Step 5  
  Highlight the miniature looking 3 that is where  a vertical bar,  |   should be.
  Do ctl-F  which will copy it into the search window.  
  For the replacement item type a vertical bar,   |   
  Click the Replace All button
Step 6  
  Highlight a single A with circles above that are in a row of those As and do ctl-F
  For the replacement item type a dash,  -
  Click the Replace All button
  At this point, the file is reasonable looking.
Step 7  
  Save the file to save the work you've done so far.
Step 8  
  At the start and end of the very long lines of dashes, there are four distinct charactors that must be replaced with dashes.
  For each of the different characters we are talking about, do a ctl-F and click the Replace All button.
Step 9  
  At the very top of the file you will see some squares mixed with charactors
  Place the cursor at the beginning of the first line and hit the delete key until they are all gone
  Press the space key until the text on the line appears centered again.
Step 10  
  About every 60 lines or so, you may find little squares and possibly the fact that there what should have been on the next line is on the wrong line.
  These squares usually represent where a Line Feed / Return is supposed to be.
  There are two ways to deal with these:
  Manually
    For each place in the file where this occurs, place your cursor in front of the first square.
    Press delete twice to delete them
    Press Return and then one space
  Search and Replace
    Find a place in the file where this occurs, place your cursor in front of the first square.
    Holding the Shift key down,  press the right arrow three times to select them.
    Do ctl-F  to copy it into the Search window
    Empty out the Replace window, hold the shift key and press Return then a space
    Click the Replace All button
Step 11  
  Save the file to save the work you've done so far.
Step 12  
  To maintain privacy of the the TDs and Organizers,  replace their address information with spaces.  Look through the entire file for all occurrences.
Step 13  
  If you want to make it fit on a 17 inch screen without the user having to scroll sideways, do the following.   If you don't do this step, people will get a scroll bar on the bottom of their screen.  No big deal really so you could skip this step as there isn't really anything out that wide there they are interested in.
  To  remove ten dashes from the really long   --------- that bracket the section information.  
  Pull the remainder of the information between the two long rows of dashes (delete the spaces before the TDs name, etc) by ten.  The stuff at the top of each separate event needs to be pulled in only 4 to make it fit.  
  The stuff at the top of each separate event needs to be pulled in only 4 to make it fit.  
  To verify that you have it all, you should be able to scroll down the entire length of the file and see the right most vertical bars on your screen.  You may have to adjust your own scroll bar first though.
  The steps in this section can be done with Search and Replace but I shall not outline it.  If you get experienced at the whole process, it will occur to you how to do it.
Advanced Tip
  EditPad has a column editing feature which I use to speed up the process a little but did not describe it.
Step 14  
  Save the file to save the work you've done so far.
Step 15  
 
If you have multiple events in that one file, you now need to separate them out. Open a new file in EditPad by hitting the New button.
  Go back to the original file by clicking on the tab at the top of the window that represents that page.
  Find the beginning of the first event and highlight to the last line of that event.
  Do ctl-C to copy that region
  Go to the tab of the new but empty page.
  Do ctl-V to paste into the region
  Do a save and provide it with a name that indicates what event it is
Important Note:
  I strongly recommend that you establish a uniform naming system for the files.  This will be of great aid in keeping things straight for your own filing, sending and receiving of the files and for the web master who has to manage lots of material arriving.  The suggested name for the example file, based on the content of the file would be
  2002-05-25_Mass_Open_USCF_cleaned.txt
  This works well when for the web master who will may also be posting the TD's version of the event.  The name of that file would be
  2002-05-25_Mass_Open_TD.txt
  Every thing sorts nicely and can be easily located.   It is important to use two digits for the month and the day.  Otherwise, it will not sort correctly.