Is their anyone who has an example of a codeunit for importing a text-file (ASCII) in navision. Just to know how to find the first record of the txt-file and how to find the next record.
Without using a dataport so I would be able to call the CU with NAS to import the file.
Thanks.
0
Comments
file.WRITEMODE(FALSE);
file.OPEN(file path and name);
REPEAT
file.READ(vstring);
// do something with vstring
UNTIL
file.POS = file.LEN;
This code reads 1 line of text at a time.
Remember, vstring can only be a max of 1000 characters so each line cannot be more than 1000 characters.
A dataport is much better to use because of this. You can also do the same thing with a dataport, some coding and the common dialog ocx.
isn't it?
for example my data is --> no,name,address
how to segregate ","
so no goes to field no, name goes to field name, and address goes to field address
thanks
here is my code and sample data
i want to segregate no,name and address
anyone can help?
thanks
viewtopic.php?f=32&t=44776
viewtopic.php?f=23&t=15461
thanks a lot for your help Luc
we use fixed length