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
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in EXCEL
- Power Query / M Code, extract a list of tables into one main table, some column headers same but some different and in different order (and in row 2)
- Is there a way to validate the cell format (from excel) to fetch the symbol from it (in Java)?
- Excel - Visual Basic, macro with autofill "1"
- Getting Run-time error '13': Type Mismatch using .Find
- Getting website metadata (Excel VBA/Python)
- Excel Code Editor doesn't work (blank window)
- How to find out how many of each 2, 3 and 4 required to fit in 100 using excel?
- How would I apply a rather complex summation formula like this in Excel?
- Removing a Button from Customized Excel Ribbon
- Excel - Update Item Description Based on Accessories Ordered with It
- select duplicates from data based on another column
- How to use VBA to bold just some text
- VBA Code to filter and get values from csv to excel worksheet
- Look up max alpha numeric value
- Azure Batch for Excel VBA
Related Questions in DBF
- dbf to csv using azure data factory
- DBF SQL Update records returned from a Select with join
- How to read dbf file with encoding cp850 in R?
- Azure function file not found App Service vs Consumption based
- Write data from hadoop file into dbf using pyspark is time consuming
- python dbf query with multiple conditions (blank and non blank conditions)
- python dbf query with multiple conditions
- Reading dbf file (visual dbase 7)
- How to load a DBF file within a zip file to a variable without extracting it in Python?
- I would like to know how to reindex Express program (.CDX) files using PHP
- System.Data.OleDb is not supported on this platform on windows server 2022 IIS
- Adding Record in DBF from VFP9 Form entry
- Error building key for index ....path tag "nameIndex" DBF
- Visual FoxPro connection driver
- python dbf query between two dates
Related Questions in WING-IDE
- Unable to import Biopython in Wing IDE
- Is there a way to install pytest on wingide?
- How to print symbols vertically in python?
- Error in wing IDE: no module named "sympy"
- Tkinter window showing up too early
- How to show project explorer pane on right side of screen
- Failure import pygame in IDE on python 3.8.3
- wingIDE not working on kali linux no error message
- How can I run the full Flask Tutorial app in the Wingware IDE?
- cannot load numpy c-extensions
- Wing IDE The debug server encountered an error in probing locals
- Is there a way to view data frames nice in Wing Personal 7.0?
- Trying to pull a twitter handle from a text file
- How to stop Wing IDE from opening imported modules on exception
- How to install wingide
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.