Appendix E -.DIF Files and Excel

Appendix E - .DIF Files and Excel ProWORX NxT User’s Guide Editing .DIF files with Microsoft Excel NxT exports database documentation in two format...
Author: Shannon Berry
31 downloads 3 Views 26KB Size
Appendix E - .DIF Files and Excel

ProWORX NxT User’s Guide

Editing .DIF files with Microsoft Excel NxT exports database documentation in two formats which Microsoft Excel can read: Ÿ dBase4 (.DBF): Use this database format if possible as Excel reads and writes it correctly. When you export a database to a .DBF file, each descriptor field and short comment becomes its own record. Ÿ Data Interchange Format (.DIF): When Excel imports a .DIF file, it converts the controller addresses in the first column of the database into numerical values which NxT cannot read. Excel also exchanges the rows and columns of the database in the .DIF file’s header. Unless you correct these problems, an error appears when you try to import a .DIF file back into NxT after you have changed it in Excel. If you prefer to use .DIF files instead of .DBF files and want to use Excel to edit documentation, follow these seven steps: Ø Step 1: Set the size of your descriptor fields for Microsoft Excel. 1.

Open your database in ProWORX NxT. v For more information, see “Opening an existing database” on page 19.

2.

From the Network Editor, on the File menu, click Utilities then click Database Setup.

3.

Change the Descriptor Field Width to 15.

4.

Change the number of Descriptor Fields to 9.

5.

Click OK. A dialog box prompting you to expand your database may appear. Click OK.

Ø Step 2: Export your NxT database as a .DIF file.

390

1.

From the Network Editor, on the File menu, click Utilities then click Import/Export.

2.

Select Export.

3.

Type the path and file name of the file to export your database to or click Browse to navigate to it.

4.

Select .DIF as the File Type to create.

5.

Click Start.

l Editing .DIF files with Microsoft Excel

Appendix E - .DIF Files and Excel Ø Step 3: Open and edit your database in Microsoft Excel. 1.

Open the .DIF file in Microsoft Excel. The spreadsheet looks like this:

A

B

C

D

E

F

...

K

1

Address 1

D

Desc. 1

Desc. 2

Desc. 3

Desc. 4

...

Desc. 9

2

Address 1

S

Comment 1

Comment 2

Comment 3

Comment 4

3

Address 1

L

Lookup 1

4

Address 1

T

Page Title

5

Address 2

D

Desc. 1

Desc. 2

Desc. 3

Desc. 4

...

Desc. 9

The number in Column A tells you what controller address the row describes. The letter in Column B tells you what information the next cells in the row contain. If the letter in Column B is...

The following cells in the row contain...

D (for Descriptors)

descriptors 1 through 9 in columns C through K.

S (for Short Comments)

short comments 1 through 4 in columns C through F.

L (for Long Comments)

a long comment lookup number in column C.

T (for Page Title)

the page title in column C.

2.

Make your changes to the documentation.

Ø Step 4: Convert the controller addresses from numbers to text. 1.

Find an unused column in the spreadsheet. This temporary column holds information during the conversion process.

2.

In the first cell of the unused column, type: =TEXT(A1,“00000”). This formula converts the numerical value in cell A1 into a text value which NxT can read. When you press ENTER, the text value appears in the cell where you entered the formula.

3.

Select the cell.

4.

On the Edit menu, click Copy.

Editing .DIF files with Microsoft Excel l 391

ProWORX NxT User’s Guide 5.

Select the temporary column by clicking its header. For example, if you entered the TEXT formula into the first cell of Column M, now select all of Column M.

6.

On the Edit menu, click Paste. This operation pastes the TEXT formula copied from the first cell of the temporary column into all the other cells in the column. Click Yes if a warning message appears telling you that the selection is too large for Undo. The temporary column now contains the same values as Column A, but formatted as text instead of numbers.

7.

Select the entire temporary column again.

8.

On the Edit menu, click Copy.

9.

Select Column A.

10. On the Edit menu, click Paste Special, then click Values. The text values from your temporary column replace the numerical values in column A. Click Yes if a warning message appears telling you that the selection is too large for Undo. 11. Select the entire temporary column. 12. On the Edit menu, click Clear then click All. The values in your temporary column disappear. Click Yes if a warning message appears telling you that the selection is too large for Undo. Ø Step 5: Export the Microsoft Excel spreadsheet as a .DIF file. Ÿ Save the edited database as a .DIF file.

392

l Editing .DIF files with Microsoft Excel

Appendix E - .DIF Files and Excel Ø Step 6: Correct the rows and columns in the .DIF header. 1.

Open the .DIF file with a text editor. Microsoft’s WordPad in Windows ‘95 or Write in Windows 3.1 open .DIF files.

2.

Switch the “VECTORS” and “TUPLES” values in the header of the .DIF file. TABLE 0,1 “EXCEL” VECTORS 0,XXXX “’’

Swap these values

TUPLES 0,X “’’

“XXXX”and “X” will be numbers.

3.

Save the edited database as an ASCII .DIF file.

Ø Step 7: Import your database back into ProWORX NxT. 1.

From the Network Editor, on the File menu, click Utilities then click Import/Export.

2.

Click Import.

3.

Type the path and file name of the Excel database.

4.

Select .DIF from the File Type box.

5.

Click Start. The open database is overwritten by the Excel database.

Editing .DIF files with Microsoft Excel l 393