Skip to main content

Posts

Showing posts from May, 2012

How to Create fresh Database with setup data

In agile software development process  Database schema is changed time to time. Most of the enterprise software applications have 'system defined data sets'  (Configurations, constants etc  )  in the Database.In case of a new release, new client,  testing etc. we need an empty Database structure with system defined data sets . This can be achieved by cleaning data-set, but sometimes this can be time consuming and error prone. An empty Database structure can be created by modern DBMS. Setup data can also be exported from Database tables. Large applications may have complex relationships with tables and data extraction may be painful.         I have used  Jailer  (Database Subsetting Tool) to extract system defined data sets. Jailer is a Database Subsetting and Browsing Tool. Exports consistent, referentially intact row-sets from relational databases (JDBC). Removes data w/o violating integrity. Generates DbUnit datasets, hierarchically structured XML and topologically

SVN get revision number list for date period

I need to get SVN revision numbers for particular date range , following steps has been done. svn log -r {2012-05-01}:{2012-05-03} URL >> svn_log_r_2012_05_01_2012_05_03.txt You will get all revisions for specified date range. sed -n '/r[0-9]/p' svn_log_r_2012_05_01_2012_05_03.txt > out1.txt Remove unwanted lines. sed 's/\([^|]*\).*/\1/' out1.txt > out2.txt Extract ‘r123’ pattern column. sed 's/r/ /' out2.txt > revision_no_list.txt Remove 'r' from file. Resources - http://sed.sourceforge.net

Find duplicate line from file

Finding duplicated lines can be done easily using regular expressions, Nowadays many text editors support  regx. Regx - ^(.*)(\r?\n\1)+$ This is my favorite editor IDEA community edition .