How to parse txt file in codeunit?

zosiawszosiaws Member Posts: 2
edited 2013-01-26 in NAV Three Tier
Hello!

I want to import some txt file and import only selected strings into table which is related with form.

Right now i've got file import, text reading but problem is in parse readed file string and insert selected string into table fields, and into form.



My codeunit looks like that:



SelectedFile := CommonDialogMgt.OpenFile('NAV File Browser', SelectedFile,1,'Filter',0);

MyFile.OPEN(SelectedFile);

MyFile.CREATEINSTREAM(StreamIn);

StreamIn.READTEXT(Bufor);

WHILE NOT StreamIn.EOS DO

BEGIN

no idea how to do it

END;

MyFile.CLOSE;





Any ideas? Please, i need this :( File.Pos or Strpos doesn't work. Please - help me!

Comments

Sign In or Register to comment.