Wednesday, May 13, 2015

unix sed command to replace & with & , " with ", < with <, > with >


sed command to replace &quot; with "

sed -ie 's/&quot;/"/g' test.xml

sed command to replace &amp; with &

sed -ie 's/&amp;/&/g' test.xml

sed command to replace &lt; with <

 sed -ie 's/&lt;/</g' test.xml

sed command to replace &gt; with >

 sed -ie 's/&gt;/>/g' test.xml

Tuesday, May 5, 2015

Unix Extract text between xml tags /anchors


Input:

<One>1</One>
<Two>2</Two>
<Three>3</Three>

Command:

sed -e 's/\(<[^<][^<]*>\)//g'  input.xml > output.txt

cat output.txt

1
2
3

Friday, May 1, 2015

Mac OS wget GUI tool utility

WgetWrapper provides an easy to use user interface for the Wget command-line tool.

Wget is designed to offer support for interactive/non-interactive downloads and is able to support several protocols such as FTP, HTTP or HTTPS.


Thursday, April 30, 2015

Maven Generate Source from WSDL and include generated source for compilation

<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>  
<artifactId>jaxws-maven-plugin</artifactId>  
<version>2.1</version> 
<executions>
<execution>
<id>wsimport-from-java</id>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<!--wsdls file directory -->
<wsdlDirectory>${basedir}/src/main/resources/wsdl</wsdlDirectory>
<!-- which wsdl file -->
<wsdlFiles>
<wsdlFile>stock.wsdl</wsdlFile>
</wsdlFiles> 
<!-- Keep generated files -->
<keep>true</keep> 
<!-- Package name -->
<extension>true</extension>
<packageName>com.stock.ws.client</packageName> 
<!-- generated source files destination -->
<sourceDestDir>${basedir}/src/main/java</sourceDestDir>
</configuration>
 
</plugin> <!-- adding generated source -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/java/</source>
</sources>
</configuration>
</execution>
</executions>

</plugin>