Difference between revisions of "Troque Week 6"

From LMU BioDB 2015
Jump to: navigation, search
(Added my solution for formatting the data for application.txt)
m (Processing the Data on the Command Line: Edited the formatting of the files)
Line 6: Line 6:
 
== Processing the Data on the Command Line ==
 
== Processing the Data on the Command Line ==
  
 +
=== Formatting the application.txt file ===
 
  cat application.txt |
 
  cat application.txt |
 
  sed "s/\t/,/g" |  
 
  sed "s/\t/,/g" |  
Line 29: Line 30:
 
  sed "1d"  > ~/public_html/application.sql.txt
 
  sed "1d"  > ~/public_html/application.sql.txt
  
From doing this assignment, I realized how badly formatted it is.
+
 
 +
=== Formatting product.txt file ===
 +
 
 +
 
 +
From doing this assignment, I realized how badly formatted these data are.
  
 
  <!-- cat application.txt |  
 
  <!-- cat application.txt |  

Revision as of 23:29, 14 October 2015

User Page        Bio Databases Main Page       


Creating the Table on PostgreSQL

Processing the Data on the Command Line

Formatting the application.txt file

cat application.txt |
sed "s/\t/,/g" | 
sed "s/,/,'/1" | 
sed "s/,'[A-Z]/&'/1" | 
sed "s/,/,'/2" | 
sed "s/\s*,False/',False/1" | 
sed "s/,/,'/5 " | 
sed "s/,/',/6" | 
sed "s/,,/,null,/" |
sed "s/,,/,null,/" |
sed "s/,\r$/,null/g" |
sed "s/,S,/,'S',/g" |
sed "s/,P,/,'P',/g" |
sed "s/,V/,'V'/g" |
sed "s/P\*/'P\*'/g" |
sed "s/S\*/'S\*'/g" |
sed "s/,AP,/,'AP',/g" |
sed "s/$/);/g" |
sed "s/^/insert into application (ApplNo,ApplType,SponsorApplicant,MostRecentLabelFlag,
                                  CurrentPatentFlag,ActionType,ChemicalType,Ther_Potential,
                                  OrphanCode) values (/g" |
sed "1d"  > ~/public_html/application.sql.txt


Formatting product.txt file

From doing this assignment, I realized how badly formatted these data are.


Assignment Links

Weekly Assignments

Individual Journal Entries

Shared Journal Entries