Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing 'General' fields of mixed types #143

Open
GoogleCodeExporter opened this issue Jul 24, 2015 · 3 comments
Open

Parsing 'General' fields of mixed types #143

GoogleCodeExporter opened this issue Jul 24, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Excel Spreadsheet of mixed fields (text, float, int) but all specified as 
'General' in Excel
2. The fields look fine in Excel, but when parsed by php-excel-reader it comes 
out all jumbled
3. When I specify the type of the field correctly in Excel then 
php-excel-reader works perfectly. 

correct: 
01/01/2012  04215702194 50.00   6.14    41.90   08630890615787207995        50.00   0
incorrect: 
yyyy/mm/dd  �04215  50505050.5050;50505050.5050;50  6666.66;6666.66;6   42424242.4242
;42424242.4242;42   �0863089061     50505050.5050;50505050.5050;50  �

[Only difference is that in Excel I have identified the fields correctly]

The problem is that I get my spreadsheet to be parsed from an incompetent 
company and they won't stick to an agreed template or detail like specifying 
field type. I simply cannot count on the column types to be specified in Excel 
and to do it myself every time defeats the point of using php-excel-reader 
(might as well just convert to csv).

Is there a way to override the automatic field identification and specify how 
php-excel-reader should interpret a column?

Original issue reported on code.google.com by [email protected] on 27 Feb 2012 at 9:35

Attachments:

@GoogleCodeExporter
Copy link
Author

this is weirder and weirder, if I process the original excel format I get the 
garbled junk, but if I open the file in excel and then save it again (no 
changes!) it processes perfectly :-/  

So, my sample works fine. 

Original comment by [email protected] on 27 Feb 2012 at 1:27

@GoogleCodeExporter
Copy link
Author

I have the same issue... I export an excel from data from a database, when I 
change some values in the excel all the digits in the excel are parsed as 
General[]... But when I import the exported list without editing it all works 
fine... So the issue seems to be with (changed) Excel-sheet. But what could it 
be? Somebody?

Original comment by [email protected] on 13 Jun 2012 at 8:15

@GoogleCodeExporter
Copy link
Author

On line 835 in the function "_format_value" in the first line I returned:

return array ('string' => $ a, 'formatColor' => null);

and it worked in my case it worked.

In case:

// ADDED by Matt Kruse for better formatting
function _format_value ($ format, $ num, $ f) {

return array ('string' => $ a, 'formatColor' => null);

}

Surely the problem with other Excel files, but in my case the execel is simple 
then it did not yield problem.

Original comment by [email protected] on 7 Jul 2015 at 8:38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant