How can I read the excel file(xslx) which is in the Sharepoint server directly from informatica Powercenter? - unix

I Have a Excel file(xlsl) with multiple worksheets in Sharepoint server which I should read in informatica and load the data into different tables.
Informatica is hosted on unix server
Currently I am thinking of the below work around but I have challenges here:
1.Copying the excel file into unix.(Once i copy the file from sharepoint server to unix using the "curl" command, the format of the file is getting changed to html. I can I retain the original excel format ,I can't install any excel utility on our server)
2.Convert them into multiple CSV files using some script (How can I do this, As I mentioned earlier I don't have any utilities like xls2csv, unoconv )
3.And read the CSV file and load them into tables.
Please let me know if there is any better approach than this.

You can try using wget to download the excel file (or set of files) from the sharepoint to Informatica file server location. It will allow you to specify the directory and target file name as well.

Related

Bulk upload using csv file to remote MonetDB server

I have a remote MonetDB server running and I want to bulk upload a csv file as it is much faster.
Based on the params in MonetDB.R, there is a csvdump=TRUE option but I don't think it works when you are trying to do this against a remote server. The server has to be local.
https://rdrr.io/github/MonetDB/monetdb-r/man/dbWriteTable.html
First, am I correct that I can't do this and if not, is there a workaround? I have a dataframe with +5M rows so it takes a long time with insert statements rather than using COPY INTO.
When I try using csvdump=TRUE against the remote server, it can't find the csv file because it is local to computer that called the dbWriteTable command.
I think you are right. As a workaround either use explicit COPY INTO ON CLIENT SQL statements or first use some file transfer tool to copy the file to the remote server before calling dbWriteTable.
It reads from MonetDB's documentation on COPY INTO:
FROM files ON SERVER
With ON SERVER, which is the default, the file name must be an
absolute path on the system on which the database server (mserver5) is
running. ...
Interestingly enough pymonetdb, the Python driver for MonetDB, uses ON CLIENT for bulk loads. From the pymonetdb's doc:
File Uploads and Downloads
Classes related to file transfer requests as used by COPY INTO ON
CLIENT.
You might want to file an issue for the MonetDB R-driver project to have similar behavior as pymonetdb.

is required to install excel software in the server to import data from excel to sql server?

one of my interview question asked by the technical team.
i have to import excel data to sql server. is required to install excel software in the server to import data from excel to sql server? I sad no need to install on server? they are asking me with out excel on server how it will read the data from excel sheet?
to read data in excel sheet from .net application is required to install excel on server?
thanks advance
Excel is not required on the sql server you are importing data on, it only requires an appropriate driver.
See more here:
http://social.technet.microsoft.com/wiki/contents/articles/24236.importing-an-excel-spreadsheet-into-a-sql-server-database.aspx
If you are reading only xls files then use Microsoft.Jet.OLEDB.4.0 that is inbuilt with your .net framework.
If you are reading xlsx files then use Microsoft.ACE.OLEDB.12.0. The drivers for this can be download freely from Microsoft site. You don't need to install Microsoft office for interoping.
There are many formats of Excel Data file such as .xls, .xlsx, .csv etc
For .csv format data file you don't need to have any 3 party tool on your system you can do that with .net StreamReader
Sample Code.
using (StreamReader sr = new StreamReader( <.CSV File Path> ))
{
while(!sr.EndOfStream)
{
string[] Line = sr.ReadLine().split(',');
//TODO: Use the String array variable Line to insert
your records one by one into database
}
}
For all other Excel formats there is a dll available.
Go To https://exceldatareader.codeplex.com/
It has given all the examples of how to use it.

How to update MYSQL Database with data from Excel using ASP.NET?

I have an excel file which gets updated every 10 seconds through an automated process. I need excel data to be updated in MY-SQL database which is located on a remote server.
How do I do that?
I have thought of following option:
1) Every 11 seconds, an Excel macro will run and will "Save as" excel as CSV file. (not sure whether this can be done by macro...just thinking)
2) This CSV file we will FTP to remote server using Windows Service.
3) On remote server, we will parse the csv file and Update MYSQL database.
Is this approach fine? Or do you have a better approach which requires less time to update the database?
Thanks!
I found following links to be more useful:
http://www.heritage-tech.net/908/inserting-data-into-mysql-from-excel-using-vba/
http://vbaexcel.eu/vba-macro-code/update-mysql-database-php
I hope this helps someone having similar problem as mine.
You can connect to the Excel spreadsheet using ODBC connection, read the data, and post it to the MySQL database, maybe through some sort of web service access, or via a saved CSV file?

Import excel file with asp.net

I'm working on an asp.net /c# app
I need my app to allow users to upload .XLS files (located on the user machine).
How can i read data from the .XLS file but without saving the file on server?
tks
In order to be able to do something with the file on the server (eg using ASP.net ) you will have to at least temporarily save the file on the server. Although an apache module might let you interupt the stream as it is uploaded, but thats probably a bit ott.
There MAY be something you could do in Javascript but I doubt it.
An idea would be to parse .csv files, if it possible. I can send example.
Also you can parse .XLS files through interop excel dll. But it very slow method.

generate excel sheet from a excel template in asp.net using vb.net

i need to generate an excel sheet from an excel template which contains drop down lists. I need to use the template and populate the with data from datbase and select the appropriate value from the drop down lists and generate the new excel sheet. I am in very bad situation and need it asap.
try spread Sheet Gear third party component
http://www.spreadsheetgear.com/
OR
http://www.smartxls.com/
You have a few options:
Third-party component ($$$) to read, modify, and send the Excel file.
Office COM automation on the back-end (bad idea. Really. Don't do it).
Save your template on the server as an XML Spreadsheet file (the XML format used by Office 2002 and 2003 and still supported in 2007). Since it's a single XML file, it can be easily read by server-side code, modified on the fly, and redirected back to the user.
Save your template on the server as an XLSX file (the newer XML format used by 2007) and modify it on the way out to the user. Much more complicated since there's a ZIP wrapper and multiple XML files involved.
Save your template on the server as a normal Excel 97/2000 file (not 2007), and when the user requests it, make a copy of the file on the server (requires write access) with a random name, open an database connection using the Excel OLEDB driver to the Excel file, perform INSERT statements into it (goes into tabs of those names, where you store your drop-down values), close the connection, and send the file. Caveat: the Excel OLEDB driver has some limitations.
Go the other direction. Use Excel's web data connection capabilities to access the server after the Excel file is already on the user's machine and open to grab the appropriate values from the server. Requires some user training to refresh the data.

Resources