PDA

View Full Version : Data manipulation with files



Eugeneb
06-04-2007, 09:19 PM
Hi

I have an application where I need to manipulate data in a Dbf file(File1), search a second file (File2) for a tagname and scale the value before populating a third file (File3) with the result.

This is how I think it should work, but how do I do it, I'm not very good with VB!


Open DbfFile (File1)

Click on macro Button

Open Eventlogged Tags File (File2)

Concatenate Addr and Rtu ie 41R24
Concatenate Date/time Columns 26/06/2007 12:35:00:000

Search Eventlogged tags file (File2) for register Number (ItemName)

If Found

Find Tagname
Find Min Raw Scale
Find Max Raw Scale
Find Min EU Scale
Find Max EU Scale
Scale Raw Value from Log File
Create String

File 3 Shows the format required. The first 3 Rows are simply a header and the rest being the data and a few extra fields.

Write to File3
repeat until EOF
Save file3 as filename= datetime.logs
Close All
Exit Excel

I have attached the files so you can get an idea of what I have to do

Cheers

Eugene