Python Forum

Full Version: How to put data into a right variable -CSV
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have exported some data to CSV from a PDF file using PDF multitool.

Sample file of the CSV data

There are some errors in the CSV as it want properly comes into right column.

I have kept only the first page headers as the other pages headers also not in right order, so ignored.

It is great if someone can help to create a python code to make a proper data set.
Please post code you have written so we can help.
Please include all error outputs (full traceback)
I'm still trying to do it using python.
Headings are:
A/C Code, Account Description, Old A/C Code, O/B Debit, O/B Credit, Current Month Debit, Current Month Credit, C/B Debit, C/B Credit

I can tabulate Last 7 variables using excel formula.
Form the right I count to number of cells contain values, if it is one took vales to last variable, if it two values taken to second from last, like did up to "old A/C code"(ie 7 from last variable)
And then copy the formula to other cells.

Like to do this using python, I have to learn more on this.
Ok, looks like you really wan't to keep am Excel format. You can do this with PyExcel. See https://pypi.python.org/pypi and search for Excel.
There are quite a few packages. I have had good luck with PyExcel, some only read, others only write. PyExcel does both.