Pages

Thursday, December 19, 2013

Data Preparation Tricks


  1. perl -p -i.bak -e 's/\bNULL\b/0/g' filename
  2. Print all rows - divide one column by another                                                                             awk '{print $1"\t"$3/$2}' merchant_ctr > merchant_ctr_final
  3. Print the rows where the ctr value is greater than 0                                                                     awk '{if($2>0) print;}' merchant_ctr_final > merchant_ctr_final_pos
  4. sd

http://www.ibm.com/developerworks/library/l-p102/index.html

No comments:

Post a Comment