CurrentPatentFlag, ActionType, Chemical_Type, Ther_Potential, Orphan_Code)  
 
  CurrentPatentFlag, ActionType, Chemical_Type, Ther_Potential, Orphan_Code)  
 
  values (/g" | sed "s/$/);/g" | sed "1D" > ~/public_html/application2.sql.txt
 
  values (/g" | sed "s/$/);/g" | sed "1D" > ~/public_html/application2.sql.txt
 +
 +
Note: After reviewing the ''Supplementary Information'' section on the Week 6 assignment page, I realized that the above command sequence could be significantly condensed. The extensive sequence of commands I made to selectively input commas was unnecessary, as int and boolean values are recognized by SQL in single quotes as well. Although the condensed sequence below is still longer than I would hope, this is mostly due to small issues with the text file that were present in only around 3 lines (e.g. replacing commas in sponsor names with <comma> and deleting excess spaces at the end of a sponsor name). Overall it is a much better sequence. I even came up with some new techniques, such as how to handle inserting NULL values in one command instead of 3 commands.
 +
 +
cat application.txt | sed "1D" | sed "s/,/<comma>/g;s/\t/,/g;s/  //g;s/,/','/g;s/^/insert
 +
into application(ApplNo, ApplType, SponsorApplicant, MostRecentLabelAvailableFlag,
 +
CurrentPatentFlag, ActionType, Chemical_Type, Ther_potential,Orphan_Code) values
 +
('/g;s/\r$/');/g;s/<nowiki>''</nowiki>/NULL/g;s/<comma>/,/g;s/ '/'/g"
    
*''Product.txt''
 
*''Product.txt''
 
   ProductMktStatus, TECode, ReferenceDrug, drugname, activeingred) values (/g"  
 
   ProductMktStatus, TECode, ReferenceDrug, drugname, activeingred) values (/g"  
 
  | sed "s/$/);/g" | sed "1D" > ~/public_html/Product.sql.txt
 
  | sed "s/$/);/g" | sed "1D" > ~/public_html/Product.sql.txt
Exception encountered, of type "Error"
[023e22fd] /biodb/fall2015/index.php?diff=2489&oldid=2242&title=Bklein7_Week_6 Error from line 434 of /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(544): DiffEngine->diag()
#1 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq()
#2 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal()
#3 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(721): DiffEngine->diff()
#4 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(859): Diff->__construct()
#5 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(980): MappedDiff->__construct()
#6 /apps/xmlpipedb/biodb/fall2015/includes/diff/TableDiffFormatter.php(194): WordLevelDiff->__construct()
#7 /apps/xmlpipedb/biodb/fall2015/includes/diff/DiffFormatter.php(140): TableDiffFormatter->changed()
#8 /apps/xmlpipedb/biodb/fall2015/includes/diff/DiffFormatter.php(82): DiffFormatter->block()
#9 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(888): DiffFormatter->format()
#10 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(802): DifferenceEngine->generateTextDiffBody()
#11 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(733): DifferenceEngine->generateContentDiffBody()
#12 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(662): DifferenceEngine->getDiffBody()
#13 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(632): DifferenceEngine->getDiff()
#14 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(453): DifferenceEngine->showDiff()
#15 /apps/xmlpipedb/biodb/fall2015/includes/page/Article.php(795): DifferenceEngine->showDiffPage()
#16 /apps/xmlpipedb/biodb/fall2015/includes/page/Article.php(506): Article->showDiffPage()
#17 /apps/xmlpipedb/biodb/fall2015/includes/actions/ViewAction.php(44): Article->view()
#18 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(395): ViewAction->show()
#19 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(273): MediaWiki->performAction()
#20 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(566): MediaWiki->performRequest()
#21 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(414): MediaWiki->main()
#22 /apps/xmlpipedb/biodb/fall2015/index.php(44): MediaWiki->run()
#23 {main}