![]() |
|
11 Aug 2014 | #1 |
|
DBF to CSV in batch: how to do?
Dear Community,
I need to convert every minute (1 minute) a file generate in format DBF into the CSV format. I looked around some script, I found one script in Python but unfortunately it doesn't work. Can you help me? Cheers, |
My System Specs![]() |
. |
|
11 Aug 2014 | #2 |
![]() Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
|
What program does create the DBF file each minute?
|
My System Specs![]() |
11 Aug 2014 | #3 |
|
Good afternoon,
thanks for the prompt reply. It is a internal monitor application for enviromental data mining. I have uploaded it here: https://www.m-e-d-i-a-f-i-r-e.com/?a2nn9ihat6zs90k Cheers, |
My System Specs![]() |
. |
|
11 Aug 2014 | #4 |
![]() Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
|
Can't you simply adjust the "monitor application" so it output to CSV?
Otherwise I don't have a solution. |
My System Specs![]() |
11 Aug 2014 | #5 |
|
Hi, no sorry I cannot...
|
My System Specs![]() |
11 Aug 2014 | #6 |
|
I think Excel can deal with both formats. Do you have it avaiable?
Try opening with Excel, and saving in CSV afterwards, see if the resulting file satisfies your needs. |
My System Specs![]() |
11 Aug 2014 | #7 |
|
Good evening,
yes, Excel is able to handle it but I have to do that via command line, as it's a trigged operation (via file batch). Regards, |
My System Specs![]() |
. |
11 Aug 2014 | #8 |
|
Great. Then, it's just a matter of scripting Excel to do the job automatically. For example, you may use VBScript to instruct Excel to load the dbf, then re-save it as csv:
Code:
Const xlCSV = 6 'Open Excel and load dbf within it Set objExcel = CreateObject("Excel.Application") objExcel.DisplayAlerts = FALSE objExcel.Visible = FALSE Set objWorkbook = objExcel.Workbooks.Open("C:\temp\test.dbf") 'Just save it without any modification, chosing CSV as format objWorkbook.SaveAs "C:\temp\test.csv", xlCSV objWorkbook.Close 'Close Excel and quit objExcel.Quit WScript.Quit Be sure to fully test it on real sample data, I've just played with it a little. While I think it's a reasonably good approach, it's definitely not production quality. For instance, it lacks error handling ![]() |
My System Specs![]() |
12 Aug 2014 | #9 |
|
Dear Alejandro85,
thank you! The script is working like a charm but I have a problem: the file keep opened in the application and I cannot copy or overwrite it again. Does it is a way to kill Excel after the conversion automatically? That script should be executed every 60 seconds. |
My System Specs![]() |
12 Aug 2014 | #10 |
|
Dear Alejandro,
I just added that to avoid the security warning when the script is launched... Quote:
set oShell= CreateObject("Wscript.Shell")
set oEnv = oShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 oShell.Run "script.vbs /norestart",0,True oEnv.Remove("SEE_MASK_NOZONECHECKS") |
My System Specs![]() |
![]() |
Thread Tools | |
Similar help and support threads | ||||
Thread | Forum | |||
Using .cmd Batch Files I use RoboCopy in .cmd Batch files, is there a way to exit like "Exit Sub" in Visual Basic Is it possible to do Visual Basic like Logic Statements? Would it be possible to, within the batch file, determine whether a Drive Letter exists, Then run robocopy if it does? |
General Discussion | |||
Batch files? hello guys im new to this forum. I'm trying to write a simple batch file which copies a couple of files from a network address to mulitple directories on the C:\ of different pc's eg xcopy from lets say A:\source.file to PC1 (directory user 1 folder, user 4 folder, user 7 folder, default)... |
General Discussion | |||
How to run a batch file at logoff & some batch scripting help please Hiya, I'd just like to run a simple batch file at logoff to backup some settings. I plan to use Robocopy, which is what i use to more thorough backups. Two questions: 1. How make it run by clicking Start > Shutdown? (i realise i could make a shutdown batch file and run it instead, but i'd... |
Backup and Restore | |||
Batch File that grabs file names from folder to insert into batch file Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i... |
General Discussion | |||
Batch, Registry & UAC Hi all, I've written a batch file which adds registry keys (with dynamic driveletter recognition) upon startup, launches a program and deletes the keys when closing the program. My only concern now is that when launching the batch, I get a UAC dialog for the registry changes. Is there some... |
General Discussion |
Our Sites |
Site Links |
About Us |
Find Us |
Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd All times are GMT -5. The time now is 19:18. |
![]() ![]() |