Monday 18 December 2017

RegEx for Parsing nested XML



<([^\s\/>]+)\s*?(?:Unit=\"([^"]+)\"\s*?)?>([^<]+)<\/



Grep Commands

grep -Eo '[0-9]{1,19}' integration.txt >number.txt
Command to grep NC id which is 19 digit from a long test file integration.txt and save it to number.txt

How to compare two columns to find duplicates in Excel

Select the Conditional Formatting button on the Home tab
Select the optionNew Rule from the buttonConditional Formatting drop-down list.
Select ‘Use a formula to determine which cells to format‘ as a rule in the New Formatting Rulewindow.
=countif($B:$B, $A1)
Click on the buttonFormat and specify the format you want to set.

http://www.javacodegeeks.com/downloads/?dlp=2016/09/GWT-Programming-Cookbook.pdf&utm_source=javacodegeeks&utm_medium=all&utm_campaign=newsletter_signup&utm_content=GWT-Programming-Cookbook



How do I check if a file exists in Java?



There are multiple ways to achieve this.
  1. In case of just for existence. It could be file or a directory.
    new File("/path/to/file").exists();
  2. Check for file
    File f = new File("/path/to/file"); 
      if(f.exists() && f.isFile()) {}
  3. Check for Directory.
    File f = new File("/path/to/file"); 
      if(f.exists() && f.isDirectory()) {}
  4. Java 7 way.
    Path path = Paths.get("/path/to/file");
    Files.exists(path)  // Existence 
    Files.isDirectory(path)  // is Directory
    Files.isRegularFile(path)  // Regular file 
    Files.isSymbolicLink(path)  // Symbolic Link