Batch file to convert .xlsx to .xml - batch-file

I have a bunch of .xls/.xlsx files being dumped from SSIS tool. Figuring out how to write a batch script to convert .xls/.xlsx files to .xml directly. Changing the extension and renaming it doesn;t fix it. So it will have to open and saved as .xml
Any help here would be appreciated.
Thanks,
V

Related

SSIS process for saving .xlsx file as .csv file

I am trying to download a .xlsx excel file from FTP server and save it in a .csv file format.
I was able to download a file from server using ftp task in SSIS and save it in a local folder now I want to save that file as csv file format for import process. I could not find a conversion method or task from .xlxs to csv. i tried script task but it didn't work. can someone please help.
The simplest way to do that will be to use an Excel source and a Flat File Destination (set it as a CSV). Hope it helps.
You can add a Script task to achieve this, and inside the script you can use Interop Library:
Converting XLSX file using to a CSV file
Convert .xlsx & .xls to .csv
How to Convert Excel to CSV using Interop

Exporting .sql file from MSI

I have an MSI file that contains several .sql script files, can anyone tell me if it is possible to extract these file and look at the content. I tried using orca to export the ISSQLScriptFile table, but the files were exported as .sql.ibd, which is useless.
Thank you!
I haven't looked at this in a long time but as I recall it's all encrypted.
https://community.flexerasoftware.com/showthread.php?188927-Extract-packed-script-sql-from-msi
"For security, the script is encrypted and then stored in the MSI package."
Someone then mentions that you can intercept the SQL files from a temp directory while the installer is running.
MichaelU could weigh in if this is still true and if there are any other work arounds.
Assuming that the files are inside the MSI file in the sense of being in the internal CAB file, then do an "administrative" install, which is not an install at all. A typical command would be:
msiexec /a [path to msi file] TARGETDIR=[path to a folder where the files will go]
It extracts all the separate files to that location.

Read FTP files without local folder in SSIS package

I'm using this link as a reference for reading a file from FTP folder. But this tutorial says that the files in the FTP folder should be loaded in a local folder and only then it can be used for processing using other tasks in SSIS.
My question is, Is it possible to read a file directly from the FTP folder without storing them in the local folder and do the ETL operations in SISS?
Any advice would be helpful, Thank you.
Not with standard SSIS components. Standard SSIS allows you to download a file from FTP server to a local folder, and use local CSV-like file as a data source. Standard Flat File Source or XML Source allows only local and mapped network folders as sources for the source File.
If you really want to combine FTP download and Data source in single data source, you can write your own Script Source Component with C# or VB.NET. It will require more efforts than using standard two components.

Batch script to archive logs by zipping

I have a requirement for a batch script. I have log file under below directory (actually multiple directories with different names under E:\TIBCO\).
E:\TIBCO\*\6.0.0\LogFiles with Spotfire.Dxp.Automation.*.*
I need to perform below steps with the batch script
move (copy and delete) all the files that are with Spotfire.Dxp.*.*.* (ex Spotfire.Dxp..1.) from the above paths to E:\TIBCO\logsArchival\rotatedDir
zip all the files that are older than 60 from E:\TIBCO\logsArchival\rotatedDir to E:\TIBCO\logsArchival\ArchiveDir
delete the zip files that are older than 120 days from E:\TIBCO\logsArchival\ArchiveDir
All the above steps need to be written to the logs.
Please take a look at these links, where your requirement has been addressed before:
MS Dos Batch delete old files in directory and Batch file to delete files older than N days
You can easily customize those scripts to accomplish the remaining compression of the files. Please note, that in DOS the compress command is COMPACT. Use COMPACT /H for usage information.

How to move a text file after importing the data using SSIS package?

I have an SSIS (dtsx) package that imports data from a text file. How can I move the text file as a step within the SSIS package after importing the data? Is there a command line utility, or do I have to write a program to do this?
You could use File System Task available in the Control Flow tab of the SSIS package to move files from one folder to another.
Here are some examples that show how to move files between folders.
How do I move files to an archive folder after the files have been processed?
How do I create a package that would copy all files from a given folder into a new folder?

Resources