How to write into excel file using ant script - ant

I have a excel file, with some column like this
Name DateTime (if value datetime existing then do not thing)
Jonh 16/07/2015 9:30 (dd/MM/yyyy hh:mm) => date in system
Jonh 16/07/2015 10:30
The question : are there any way to write some sciprt ant to update excel file with two properties : Name and DateTime
When i run script ant, it's could be write new next row
Jond 16/07/2015 11:30
Thanks.

I would suggest using an Excel manipulation library such as Apache POI called from a custom task or a JDBC driver for Excel, using the SQL task to update the XLS file.

This is not a trivial problem to solve. The following example uses a groovy script leveraging Apache POI to read/write Excel files:
Using apache ant commands to store value to excel cell
store ANT regex in an excel file

Related

Joern:how to use ast's csv file to make cpg's csv file by joern?

As we all know,joern can easily analysis project written by c/c++,and it will generate CPG(code property graph).
Now I hava 2 csv file(nodes.csv and rels.csv),the 2 csv file can build AST(abstract syntax code)by neo4j and it can be shown in neo4j.But AST is not enough for me,what i need is CPG.How could i use the 2 csv file to build a CPG and show it in neo4j.I wanna to know how to use joern to make my ast'csv file become cpg'csv file.Or you hava other ways to make me do this.
I relly need your help,please.Thank you very much.

Ruby on Rails Excel file formula calculate without any manual interaction

Am trying to use selenium webdriver in ruby on rails for import test case but most of my Excel file has "=Now()" formula so when without open and save that file manually i try to import it showing old date only
Actually am unable to use below mentioned logic in ROR
XSSFWorkbook workbook = new XSSFWorkbook(file);
workbook.setForceFormulaRecalculation(true);
XSSFFormulaEvaluator.evaluateAllFormulaCells(workbook)

How to convert Db2 query result set to an XML file based on a given XSL using IBM DataStage?

Trying to covert a Db2 query result set to an xml file based on xsl. Can we use the below pattern?
DB2 Connector -> XML_Transformer Stage (imported xsl) - XML _Output Stage.
Thanks...R
There are multiple options assuming you do not have XML already in your Db2 table,
you do not need the XML Transformer.
I strongly suggest you use the modern Hierarchical stage (also known as XML stage depending on the version of DataStage) so I would go for following structure if you want a file or files as a target.
Db2 Connect -> Hierarchical stage -> Sequential File stage
In addition, Db2 offers lots of XML functionality to generate XML by using SQL or XQuery.

BiPublisher Sheet name of .xpt report when outputting as excel

Currently, when displaying (downloading) my .xpt bipublisher report as a .xlsx, my only sheet's name is Sheet1. I would like to rename it.
I know you can create xls templates directly and simply rename the sheet, but I'd need to recreate the whole report...
For RTF templates, you can specify a spreadsheet-sheet-name command.
This is from the Oracle Fusion Middleware Report Designer's Guide for Oracle Business Intelligence Publisher - 11g Release 1 (11.1.1) regarding RTF templates:
<?spreadsheet-sheet-name: xpath-expression?>
Where xpath-expression is an XPath expression or a string constant.
The example given is:
<?spreadsheet-sheet-name: {concat(.//YEAR, ' ',.//STATE)}?>
(The guide for 12.2.1 has the same; I do know know about anything prior to 11.1.1.)
Using a RTF you can actually created multi-sheet excel file and also you can rename the sheet. In order to create multiple sheet you need the following instruction:
<?split-by-page-break:?>
And before that instruction you need you use this one:
<?spreadsheet-sheet-name: xpath-expression?>
Next some examples:
<?spreadsheet-sheet-name: {concat(.//name, '')}?> --> It concatenates
<?spreadsheet-sheet-name: {.//name}?> --> It only use the XML field
<?spreadsheet-sheet-name: {normalize-space(upper-case(.//name))}?> --> It applied a trim and upper functions
In my case in my XML data file, i have this field called "name" in a third level:
<sales>
<division>
<name>Groceries</name>
<year>2014</year>
<totalsales>3810</totalsales>
<costofsales>2100</costofsales>
</division>
<division>
...

Ant Script to find substring

How to write ant script to get a substring from one property file and copy in another property file?
For Eg. I am getting oracle_12c in a property file but now I want to store oracle in one value and 12c in another value in a property file.Can anyone suggest how to write antscript for this.

Resources