Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

We have large set of data in form of hard copy that may be registers,books or something else which contains records of students,teachers & other.

Is there any easy way i can do using PHP so that we can transfer that paper based or hard copy data to mysql database.

The data is in record form.If anyone has faced this before please let me know if it is possible or not.

If i am not clear please feel free to ask for more clarifications.

Thanks & Regards,
Zeeshan.
Posted
Comments
Richard MacCutchan 15-Jan-14 4:11am    
The first thing you need to do is digitize the data. There is no other way to get it into a database.
Zeeshan17 15-Jan-14 10:07am    
Thanks for your response.Please let me know if you have any idea of how to digitize the data.
Richard MacCutchan 15-Jan-14 12:18pm    
Sorry, no. I think you will have to find a company that specialises in doing that for you.

You would need to scan the paper forms, OCR them some way, split the fields into individual fields and then insert them into appropriate database columns.

In the past I have found that employing someone to data-entry the data has proven cheaper and more accurate.

Not as much fun, of course :)
 
Share this answer
 
Comments
CHill60 2-Mar-14 20:10pm    
"Not as much fun" ... nope ... but we live in the real world. DataPrep definitely the cheapest way forward on this one, plus perhaps some justification for storing historical data in that format (we just scanned it all in, indexed it with a reference and left it until the legal/mandatory time was up!) ... which is a long winded way of saying +5
Hello Zeeshan,

You can cannot directly store hard copy data into mysql database. For this you might require an software which will scan those hard copy pages and then convert those pages into excel file format or .CSV file format then it can be inserted into mysql database using php code.

And another way is that you can create and basic data entry form in php and insert those hard copy data into data entry form and it will store into mysql database.
 
Share this answer
 
Comments
Zeeshan17 15-Jan-14 10:08am    
Thanks Kush.

I don't want to use data entry form but your first option is what i have in my mind that is something scan & transferring it to CSV & upload.

Kindly let me know if you have any idea how to transfer scan copy to csv files.
Hello Zeeshan,

You can use Lua-GD, a binding for C's gdlibrary for drawing.

You must first install gd and all it's dependencies, then install Lua-GD, as the manual says.

Here is the Lua code to do what is requested:
PHP
require 'gd'

local f = io.open('file.csv', 'w')

local img = gd.createFromPng('image.png')
for y = 1, img:sizeY() do
    local line = ''
    for x = 1, img:sizeX() do
        local r, g, b = img:getPixel(x, y)
        line = line .. r .. ', ' .. g .. ', ' .. b .. ', '
    end
    line = line:gsub(',$', '\n') -- remove last comma
    f:write(line)
end
f:close()

Try out this code snippet.

[edit]Code block corrected[/edit]
 
Share this answer
 
v2
Thanks guys. A lots of thanks. =)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900