Lengkap

Use Visual Foxpro 9 to transfer all cells from an excel worksheet into a DBF file

I will provide an Excel file. Sucessfull programmer will provide a PRG creates a DBF and populates it with data from the Excel file.

DBF file will have following fields:

CREATE DBF output (sht N(1), cll C(5), ty C(1), chrc c(75), nm n(14,2))

sht: Worksheet (1..10)

cll: Cell Reference (a1..q3500)

ty: Data type (C..N)

chrc: If cell contains character data, populate with cell's contents

nm: If cell contains numeric data, populate with cell's contents

My first stab at this project looks like this. You can fix this code or start over - either is fine with me as long as I can figure out what you did and incorporate into rest of the project.

CLOSE ALL

*** Create database

SELECT c

CREATE DBF c:\tmp (sht N(1), cll C(5), ty C(1), chrc c(75), nm n(14,2))

*** Create Excel Object & Open workbook

SELECT a

le = CREATEOBJECT("[url removed, login to view]")

ws = "C:\[url removed, login to view]"

lw = [url removed, login to view](ws)

*** Process every worksheet in workbook

FOR s=1 TO [url removed, login to view]

ls = [url removed, login to view](s)

y=0

*** Determine row count in Col F, not to exceed 3500

x = 1

FOR r=1 TO 3500

cell = 'F' + ALLT(STR(r))

TRY

val = [url removed, login to view](cell).value

if isnull(val)

x = x + 1

endif

ENDTRY

IF x = 50

max = r

ENDIF

ENDFOR

? max

*** Process rows

FOR r=1 TO max

cell = 'F' + ALLT(STR(r))

try

val = [url removed, login to view](cell).value

if .not. isnull(val)

v = VARTYPE(val)

APPEND BLANK IN C

REPLACE [url removed, login to view] WITH s, [url removed, login to view] WITH cell, [url removed, login to view] WITH v

? y, s, cell, val, v

endif

ENDTRY

ENDFOR

ENDFOR

[url removed, login to view](1).Saved = .T.

cl = [url removed, login to view]

qu = [url removed, login to view]

## Deliverables

Kemahiran: Kejuruteraan Perisian

Lihat lagi: r architecture, prg, le code, in visual foxpro, $ in visual foxpro, exceed database, data str, workbook foxpro, what is foxpro, val , v-max, tb, str, open CL, foxpro, dbf, create excel worksheet, create an excel, character figure, cells

Tentang Majikan:
( 8 ulasan ) Chesterfield, United States

ID Projek: #2766350

Dianugerahkan kepada:

kalpesh2804

See private message.

$100 USD dalam 2 hari
(24 Ulasan)
4.3

7 pekerja bebas membida secara purata $104 untuk pekerjaan ini

vnb400sl

See private message.

$120.7 USD dalam 2 hari
(95 Ulasan)
5.6
expertcoder1vw

See private message.

$161.5 USD dalam 2 hari
(30 Ulasan)
5.2
JBet

See private message.

$150.45 USD dalam 2 hari
(8 Ulasan)
3.2
Ohmganesh

See private message.

$111.35 USD dalam 2 hari
(7 Ulasan)
2.9
subramaniankv

See private message.

$161.5 USD dalam 2 hari
(8 Ulasan)
2.4
ashiva1976

See private message.

$15 USD dalam 2 hari
(4 Ulasan)
1.6
vijaytechnology

See private message.

$70.55 USD dalam 2 hari
(1 Ulasan)
0.2