Extracting BLOB data from Excel with PHP - php

I have an excel with data exported from one MSSQL database.
I want to get the data out of this file. The filereading is easy, everyone could do it, but is there any special work I have to de around the BLOB field to take it out safe and put it in a file.
This field contains either a HTML or a RTF file (i have another field which tells me if it is HTML or RTF).

Related

How to write data to an formatted & styled xls file with php (update data)

I have a formatted and styled xls file with dummy data on my server. I want to use this file as a base for all of my exports. I want to replace the dummy data with real one at the time of export with php.
I have read about phpoffice library, but I am not sure how should I proceed with that. How should I write to xls and replace dummy data while maintaining the original format and styles.

CI Export CSV data formating issue

I'm learning PHP & CodeIgniter 3. In this project I need to export some data to a CSV file. I'm able to export the CSV file, however the data is displaying incorrectly in a couple columns. Example (5.32856E+11) where it should be (532856165001). I'm able to see the actual value if you double click the cell.
Is there anyway to force the data in a CSV to display the data correctly?
This is the microsoft excel formatting and does not have any relation with your code just try to regenerate your csv and then re-open your file with a simple text editor (notepad++ or sublim text)

Importing data from PDF to Database using PHP

Can we able to read the data from a PDF file to PHP.
We are able to read data from an excel or csv file, that can be directly imported to db using PHP.
Similarly is there any way to read data from a pdf file, and import it to database using PHP.
For Eg:
in a pdf file i have a table employee details
can we able to import that data to db using php..
You can try something like PDF Parser - http://www.pdfparser.org/
This will allow you to extract text from a PDF. From there, you can create a script to parse the extracted text and insert it into your database.

how to read and write excel file from browser and then updating the values to the database

i have a html dynamic html table, i want to download this table as excel file.And after downloading i could make some changes in it and again upload it to a folder where it would change the database data according to fields..I was able to download the html table to an excel file, but have no idea how after changing the contents in the excel file would update the database according to it.I have heard of tongue twisters but this nerve twisting.
You may want to take a look at the PHPExcel library, available at phpexcel.codeplex.com.
If you want to do this with JS (I not recommend) you could copy/paste the excel content to a textarea in your HTML and then with JS you can do:
var temp = document.getElementById("yourtextarea").value.split(" ");
Since excel by default separates columns with '(tab)' you can explode it and save in the DB. You will also have to explode the newlines. It could be \r\n or just \n depending on your OS. After doing so, you can commit it to the database, row by row using Ajax.
If you can do it with PHP then would be much more easier. You could you explode() using newline at first (to break lines) and tab at finally (to break columns).

Exporting from PHP to Excel - cell formatting

I am exporting data from a database to an Excel file using PHP and a Codeigniter to_excel helper.
Everything is working correctly, except I have a field that contains data in the format of 1-1, 2-1 etc. When I open the file in Excel, Excel is automatically formatting this data as a date field so that it appears 01-Jan, 02-Jan etc.
Is there a way to force Excel not to format this data as a date field?
Thanks.
Preface the data with a single apostrophe so that Excel treats it as text. This needs to be done before it is opened in Excel.

Categories