Write data in xlsm using OpenTBS - xlsm

I'm trying fill data in .xlsm template, which contain lot of VBA calculations. When I open merged file in MS Excel, file is corrupted and Application propose repair it. After repairing, I see new blank sheet, and lost formatting in old sheet which I've merge.
In debug I see this :
* Deleted files in the archive:
- xl/calcChain.xml
* Added files in the archive: none
* Modified files in the archive:
- xl/_rels/workbook.xml.rels
- xl/sharedStrings.xml
- xl/worksheets/sheet1.xml
- [Content_Types].xml
What i do wrong ? Or maybe OpenTBS does not support .xlsm format ?

Related

How to manipulate the content of a MS Word compressed file format

I know that the microsoft docx file format is a compressed zip archive. I analyzed it and I think I understand that I can manipulate it by changing the content of the /word/document.xml file inside this file structure.
But after I zip the folder again and try to open it, MS-Word complains with a message like:
"The file ... cannot be opened because its content is causing problems. "
I wonder which is the correct method to zip the content of the xml files after manipulating? Or is there something like a checksum I have overseen?
The reason why ms word complains about my manipulated docx format was, that the compressed file structure was within another folder, which I created to edit the document.xml file.
It is important that the xml files are located in the same root folder structure as in the original file.
A similar question has been asked on StackOverflow here.

Opening Excel File with ClosedXML throws System.ArgumentNullException

Every time I try to open an Excel file with ClosedXML with the following code
XLWorkbook spreadsheetDocument = new XLWorkbook("Sample.xlsx");
I get a System.ArgumentNullException. However, I made a copy of that file in Excel, I renamed it and I have opened it succesfully. I compared both files using the Open XML Productivity Tool and I got the following output.
I wonder if those differences have something to do with the fact that I cannot open Sample.xlsx using ClosedXML. Thank you for your help.

SQL Developer won't attempt to import an .xlsx file because it's too large

I have two .xlsx files that total 1.6 million rows, and I'm trying to import these things into SQL Developer.
I right click the table name and select "Import Data..." and then select my file and nothing happens. It logs my attempt to open this file in the "File - Log" output
This is two separate attempts to import the same file logged here. When I click one of them, I get the following message:
However, I know that this warning is not true, because my attempts with importing a smaller .xlsx file are successful. So I figured the problem was just the file size is too large, and tried to change the memory available. I went into "C:\Users\User\Documents\sqldeveloper\sqldeveloper\bin" and changed sqldeveloper.conf to change one existing value to
AddVMOption -XX:MaxPermSize=2048M
and added another value
AddVMOption -Xmx2048M
Which helps the Java VM according to this source:
http://codechief.wordpress.com/2008/07/30/configuring-oracle-sql-developer-for-large-files-fix-out-of-memory-errors/
But this did nothing for me, and I still receive the same errors. I am using SQL Developer version 3.2.20.09 but I have also tried this on 4.0.1.14 to the same effect.
Many thanks!
I tried looking into SQL*Loader. Apparently you should be able to right click a table > Import Data > next and there should be an option to generate SQL*Loader files.
Unfortunately, not only did the import wizard not open with my large .xlsx files, the SQL*Loader option was not even present for smaller .xlsx files, or even .xls for that matter.
In the end, I decided to convert my .xlsx files into .csv and import those instead. This worked for all but 4 rows of my 1.6 million, and gave me the insert statement for those 4, of which 2 worked when run with no additional modifications.
In case of large volume of data, add a line "AddVMOption -Xmx4096M" to the sqldeveloper.conf file and even if it is not working change your file to *.csv format instead of *.xls. It will work fine.

Talend tWaitForFile insufficiency

We have a producer process that write files into a specific folder, which run continuously, we have to read files one by one using talend, there is 2 issues:
The 1st: tWaitForFile read only files which exist before its starting, so files which have created after the component starting are not visible for it.
The 2nd: There is no way to know if the file is released by the producer process, it may be read while it is not completely written, the parameter _wait_release_ of tWaitForFile does not work on Linux system !
So how can make Talend read complete written files from a directory that have an increasing files number ?
I'm not sure what you mean by your first issue. tWaitForFile has options to trigger when files are created, modified or deleted in a folder.
As for the second issue, your best bet here is for the file producer to be creating an OK or control file which is a 0 byte touch when it has finished writing the file you want.
In this case you simply look for the appearance of the OK file and then pick up the relevant completed file. If you name the 2 files the same but with a different file extension (the OK file is typically called ".OK" then this should be easy enough to look for. So you would set your tWaitForFile to look for "*.OK" files and then connect this to an iterate to a tFileInputDelimited (in the case you want to pick up a delimited text file) and then declare the file name as ((String)globalMap.get("tWaitForFile_1_CREATED_FILE")).substring(0,((String)globalMap.get("tWaitForFile_1_CREATED_FILE")).length()-3) + ".txt"
I've included some screenshots to help you below:

Merging multiple MS Word documents already saved in one docx file with OpenXML

I did the merging multiple documents into one singe document (Test.docx) with FeedData and it works fine.
When I open the merged document Test.docx with WinZip, content looks like this:
File1.docx, File2.docx, File3.docx, where all merged documents are being stored like external files into Test.docx file.
Now wondering if there are possibility to be created one single document Test.docx with whole content inside instead of multiple files to be stored as it noted above, this will helps me a lot when I'm making Search / Replace content since like this, we opening file by file procedure?
Note: If I open the Test.docx via MS Word and press "Save", MS Word do the job but I would like to produce the same result via code?
Thank you in advance.
Best
Tod
Take a look at this article, and see if this is what you're looking for:
http://blogs.msdn.com/b/brian_jones/archive/2008/12/08/the-easy-way-to-assemble-multiple-word-documents.aspx
Another way to merge multiple Open XML DOCX files into a single file is using the DocumentBuilder module that is part of Open-Xml-PowerTools, which is an open source lib on github.
https://github.com/OfficeDev/Open-Xml-PowerTools
more info about DocumentBuilder: http://openxmldeveloper.org/wiki/w/wiki/documentbuilder.aspx
Given that you want to do search and replace, check out OpenXmlRegex, also part of Open-Xml-PowerTools:
http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2014/07/22/search-and-replace-content-in-docx-pptx-using-regular-expressions.aspx
All open source, all free (both as in beer and speech).