I am trying to move a column of data (mean values) from a dbf file to an excel spreadsheet. I have been trying this with Wing IDE with no success so far. I am not a progamming student and this is a short term assignment. I am stuck on the part where I have to retrieve the file from the specific network drive and copy the data onto my local excel sheet. Help would be great. Thanks
Importing data from dbf to excel spreadsheet using Wing IDE
4.1k views Asked by user1603825 At
2
There are 2 answers
6
Ethan Furman
On
You need the Python Excel tools, and I would also recommend my own dbf package.
import dbf
import xlwt
dbf_files = ('file1.dbf','file2.dbf','file3.dbf')
output_xls = xlwt.Workbook()
sheet = output_xls.add_sheet('sheet_name')
for i, filename in enumerate(dbf_files):
total = 0
with dbf.Table(filename) as table:
for record in table:
total += record.some_count # some_count being a field name in the dbf files
sheet.write(i, 0, filename)
sheet.write(i, 1, total)
output_xls.save('final.xls')
Hopefully this will give you an idea of how to handle your use-case. Let me know if you have any questions.
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in EXCEL
- Concatenate excel cell string within cell reference string
- Use hidden information for filtering data
- Using Vlookup in Excel sheet to match substring
- Import from api into multiple excel cells
- Loop through list of files and open them
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Loop with equation for upper limit
- excel vba null value in array
- Why is my xml file having these after convert from excel?
- TextToColumns function uses wrong delimiter
- Difference between two dates in excel 2013
- Concatenate string and number as number
- Why in a pivot the "include new items in manual filter" option is grey out when source is a powerpivot?
- Count Unique Values Repeated Dates
- How do I extract info from crunchbase
Related Questions in DBF
- Problems with encoding in DBF table
- Adding data to DBF file adds column _NullFlags
- parsing DBF files and excluding lines that have a set date condition
- Removing Duplicate Rows From Advantage Database Server 10.1 Table
- Read Data from .dbf File with OdbcConnection
- What is a Memo Backup File ? Retrieving data from a .TBK file dump (TheOS POS Sytem)
- C# visual foxpro dbf indices
- Trying to insert a Date(without Time) into a .DBF(Visual Fox Pro Database) with C#
- How to find the default location in which Oracle DBF files are created?
- ERROR External table is not in the expected format when I get data from file dbf in C#
- Conversion Failed Due To Data Overflow (Numeric)
- import a DBF file in SQL Server using SQL Script
- Easiest way to continually import data to MySQL from a dbf file on my local computer
- Two select statement in a query .dbf
- How to reference cells from DBF with python?
Related Questions in WING-IDE
- In Python Wing IDE, how to navigate to file from keyboard?
- How do you index a list in a txt file and call on the indexed values?
- How to convert list of floats into strings to append to another list
- Distance between two points using the distance formula
- Python interpreter crash from within WingIDE
- Setting up a WingIDE environment for python scripting for MCEdit
- Django not working on Wing IDE
- Python: Slot Machine Code Error
- Slot Machine Game in Python- Repetition of Lines
- Generate function calls tree from multiple Python files
- Tkinter window showing up too early
- How to show project explorer pane on right side of screen
- PyDev Interactive Python Shell in Eclipse
- Making Wing IDE wrap lines on one file
- Syntax highlighting for coffeescript in Wing IDE
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
As I understand it, you can use ADODB with Python. You can run a query against a connection to insert into a Excel file from a DBF.
This works in VBA, hopefully you can translate.