{"id":17,"date":"2009-06-01T09:35:50","date_gmt":"2009-06-01T13:35:50","guid":{"rendered":"http:\/\/192.168.17.17\/wordpress\/?p=17"},"modified":"2010-08-14T12:48:53","modified_gmt":"2010-08-14T16:48:53","slug":"dumping-checking-dbtext-data","status":"publish","type":"post","link":"https:\/\/www.bobsown.net\/?p=17","title":{"rendered":"Dumping &amp; Checking DBText Data"},"content":{"rendered":"<p>DBTextCheck will check exported borrower, catalog or loans files for blank records or missing required fields.\u00a0 The name of the file to be checked is the only required parameter.\u00a0\u00a0 Blank record output defaults to <em>DBTblanks.csv<\/em>.\u00a0 Records missing required fields will be written to <em>DBTinvalid.csv<\/em>.<\/p>\n<p>DBTextCheck will produce a summary of each field showing the field name, blank count, maximum length and number of CR\/LFs in the field.\u00a0 DBTextCheck can be downloaded <a title=\"DBTextCheck\" href=\"wp-content\/uploads\/koha\/dbtextcheck\">here<\/a><!--more--><strong><\/strong><\/p>\n<p><strong>Checking Steps<\/strong><\/p>\n<ol>\n<li>Modify DBTextCheck to select the fields to be checked.\u00a0 For example : I have set &#8220;First Name&#8221;, &#8220;Last Name&#8221; and &#8220;Company&#8221; as the fields to be checked for blank records.\u00a0 These field names have been modified or added to the original DBText for Libraries database.\u00a0 The required fields for borrowers are &#8220;City&#8221;, &#8220;State&#8221; and &#8220;Zip&#8221;.\u00a0 Capitalization is important.<\/li>\n<li>Export the Borrower.tba, catalog.tba, and Loans.tba files.\u00a0 Set the Exports Options to:\n<ul>\n<li>Delimited ASCII Format<\/li>\n<li>Record Separator &#8212; {3}<\/li>\n<li>Field Separator&#8211;{4}<\/li>\n<li>Entry Separator&#8211;| (the default value)<\/li>\n<li>Quote Character&#8211;&#8221; (the default value)<\/li>\n<li>Check &#8220;Store Field Names in First Row&#8221;<\/li>\n<li>Records to Export&#8211;Export Entire Textbase<\/li>\n<li>Fields to Export&#8211;Export All Fields<\/li>\n<\/ul>\n<\/li>\n<li>Run DBTextCheck on each of the files and look at the blank and invalid ouput for each.<\/li>\n<li>Fix or delete the errors in DBText.<\/li>\n<li>Repeat 2-4 to remove as many errors as you can.<\/li>\n<\/ol>\n<p><strong>Program Details<\/strong><\/p>\n<p>DBTextCheck is written in Perl and uses Getopt::Long.<\/p>\n<p>It starts by reading in the first record to save the field names in @headers.\u00a0 A hash, %field_no, is set up to be able to check fields by name.\u00a0 The first field is used to determine which file type is being processed.\u00a0 This is used to specify which fields are being checked for blank or required fields.\u00a0 You will want to look at these field names in the code as described in step one above.<\/p>\n<p>As each record is read in, each field is checked for CR\/LFs.\u00a0 They are counted and converted to the pipe character, |, which is the default entry separator.\u00a0 Leading and trailing double quotes and white space (blanks or tabs) are removed.\u00a0 Blank entries are also removed.<\/p>\n<p>If <strong>all<\/strong> of the fields check for blank records are missing, the record is counted as a blank record. If <strong>any<\/strong> of the required fields is missing, the record is counted as an invalid record.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DBTextCheck will check exported borrower, catalog or loans files for blank records or missing required fields.\u00a0 The name of the file to be checked is the only required parameter.\u00a0\u00a0 Blank record output defaults to DBTblanks.csv.\u00a0 Records missing required fields will &hellip; <a href=\"https:\/\/www.bobsown.net\/?p=17\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[16],"tags":[],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-conversion-to-koha"],"_links":{"self":[{"href":"https:\/\/www.bobsown.net\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bobsown.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bobsown.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bobsown.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bobsown.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":3,"href":"https:\/\/www.bobsown.net\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/www.bobsown.net\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions\/195"}],"wp:attachment":[{"href":"https:\/\/www.bobsown.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bobsown.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bobsown.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}