Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import data to the datawindow

Status
Not open for further replies.

paul102384

Programmer
Oct 5, 2007
30
hi to all pb programmers,

i want to import a text file(tab delimited) to the datawindow
whereas in a text file, for every line, the first character should be letter D or H,
and then, D should be imported to 1st datawindow or dw_1 while H will go to another datawindow which is dw_2...

e.g.
H 1001 0 4894.04000
D 1002 0 4895.04000
H 1003 0 4896.04000

my codes looks like this:

docpath = w_glimport.sle_1.Text
i_open = FileOpen(docpath, LineMode!)//
i_read = FileRead(i_open, s_input)//
s_im = mid(s_input,1,1)//
IF s_im = 'H' THEN//
import = dw_1.ImportFile(Text!,docpath)//
END IF

- the problem is the import variable returns -2 which means empty file and no records or data can imported..

can someone give me the codes to fix this problem..

tnx...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top