Thursday, July 10, 2008

Build materials

Combine all SQL scripts from CVS links into one

I was asked to create a single SQL script from a document that has cvs links for each sql. Here is what I did,
  1. Download DAP a.ka. Download accelerator
  2. Copy all the CVS links into a text file
  3. Replace "&view=markup" and "&view=auto" with blanks
  4. Open Download accelerator and import the text file (File -> Import -> Plan text file)
  5. Download all
  6. exeute dos2unix command in downloaded directory
  7. execute this command in unix (or cygwin for windows)
    find . -type f -iname "*.prc" -exec cat {} >> ../sp_implementation_script.txt \;
  8. execute this command to generate list of file names included with number of files
    $ echo -e "Number of files \n---------------\n`ls -1 | wc -l`\n\nFile Name\n---------" > ../sp_implementation_script_list.txt
    find . -type f -iname "*.prc" -exec ls {} >> ../sp_implementation_script_list.txt \;
  9. execute this command in unix (or cygwin for windows)
    find . -type f -iname "*.prc" -exec cat {} >> ../sp_rollback_script.txt \;

  10. execute this command to generate list of file names included with number of files
    $ echo -e "Number of files \n---------------\n`ls -1 | wc -l`\n\nFile Name\n---------" > ../sp_rollback_script_list.txt
    find . -type f -iname "*.prc" -exec ls {} >> ../sp_rollback_script_list.txt \;