PHP & # 8594; Loading SQL Server + Excel from a specific row

I have a requirement in which I need to upload an excel file to a SQL Server database. It works well up to this point.

But sometimes I get an excel file such that the first 2 rows and columns are empty rows. It is not even fixed every time. therefore, the table format after loading does not meet expectations. It designates F1, F2 as the column names for the table in SQL Server.

It varies from file to file. I want to program it so that the user can enter the row number and column number from where the actual data starts. So, loading it, you need from row 3 and column 2.

I do not know how to specify this row and column when loading. Please help me solve the same.

+3
source share
2 answers

You can use http://phpexcel.codeplex.com/

You can use this to check if and where the expected data is in excel. If not, you can try to find the first column / row with the data and work from there.

+1
source

First of all, you can ask your user before starting the download (in the form using input type = "file") and after the user downloads the file, and you will show him the excel data analyzed (according to your script). To get a more specific answer, you should at least say why you are parsing excel files and what excel format you use ...

0
source

Source: https://habr.com/ru/post/1746540/


All Articles