Discussion:
Get Struct and lenght
(too old to reply)
Alonso Vilela
2007-02-09 17:26:56 UTC
Permalink
Hi some customer send me files with different kind of structure, length and
extension.

I have to create a procedure or form that read the file from any path and
store table with structure,file type and biggest length of the source file.

c:\jobs\data1.txt

Table DATA1fox.dbf
idnum c 15
lname c 25
fname c 13
amount n 8,2
address c 60

Any suggestion
Stefan Wuebbe
2007-02-09 17:55:53 UTC
Permalink
Post by Alonso Vilela
Hi some customer send me files with different kind of structure, length
and extension.
I have to create a procedure or form that read the file from any path and
store table with structure,file type and biggest length of the source file.
c:\jobs\data1.txt
Table DATA1fox.dbf
idnum c 15
lname c 25
fname c 13
amount n 8,2
address c 60
Does the number of separator spaces vary? If so, Append From
might not be useful, right? You can probably use ALines() and
GetWordNum()

* example code
cText = _cliptext
FOR i = 1 TO ALINES(aTemp,m.ctext)
? aTemp[i]
ENDFOR
? GETWORDNUM(aTemp[2],1)
? GETWORDNUM(aTemp[2],2)
? GETWORDNUM(aTemp[2],3)



hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Cindy Winegarden
2007-02-11 19:31:48 UTC
Permalink
Hi Alonso,

Are you saying that the files you are working with are data files and you
want to know the structure? If so look at AFields() in Help.
--
Cindy Winegarden
***@cindywinegarden.com


VFP OLE DB: http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx
VFP ODBC: http://msdn2.microsoft.com/en-us/vfoxpro/bb190233.aspx
Post by Alonso Vilela
Hi some customer send me files with different kind of structure, length
and extension.
I have to create a procedure or form that read the file from any path and
store table with structure,file type and biggest length of the source file.
c:\jobs\data1.txt
Table DATA1fox.dbf
idnum c 15
lname c 25
fname c 13
amount n 8,2
address c 60
Any suggestion
Loading...