You can write a custom codeunit or a custom report, open file and stream and read data from the stream. I prefer codeunit and i always use this example code:
MyFile.OPEN(FullFileName);
MyFile.CREATEINSTREAM(StreamInTest);
WHILE NOT StreamInTest.EOS DO BEGIN
StreamInTest.READTEXT(Buffer);
// insert here your code
END;
MyFile.CLOSE();
MyFile is a File variable, StreamInTest is a InStream variable and Buffer is a text variable.
You can use a dataport in the older versions. But those don't work with the NAS.
Something that works with all versions is a codeunit and using a FILE variable (and with the newer versions best use also a stream instead of reading/writing directly to the file-variable).
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You can write a custom codeunit or a custom report, open file and stream and read data from the stream. I prefer codeunit and i always use this example code:
MyFile.OPEN(FullFileName);
MyFile.CREATEINSTREAM(StreamInTest);
WHILE NOT StreamInTest.EOS DO BEGIN
StreamInTest.READTEXT(Buffer);
// insert here your code
END;
MyFile.CLOSE();
MyFile is a File variable, StreamInTest is a InStream variable and Buffer is a text variable.
But in RTC you first need to copy the file to the server, correct?
You can write a custom codeunit or a custom report, open file and stream and read data from the stream. I prefer codeunit and i always use this example code:
MyFile.OPEN(FullFileName);
MyFile.CREATEINSTREAM(StreamInTest);
WHILE NOT StreamInTest.EOS DO BEGIN
StreamInTest.READTEXT(Buffer);
// insert here your code
END;
MyFile.CLOSE();
MyFile is a File variable, StreamInTest is a InStream variable and Buffer is a text variable.
But in RTC you first need to copy the file to the server, correct?
I prefer to use shared folder (i.e. \\192.168.1.100\share\file.txt) but yes, generally you need to copy file on server.
Answers
MyFile is a File variable, StreamInTest is a InStream variable and Buffer is a text variable.
Something that works with all versions is a codeunit and using a FILE variable (and with the newer versions best use also a stream instead of reading/writing directly to the file-variable).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
But in RTC you first need to copy the file to the server, correct?
I prefer to use shared folder (i.e. \\192.168.1.100\share\file.txt) but yes, generally you need to copy file on server.
How should i add my code just give a example.
hypothesize we need to import employees and we have a file lyke this
the code will be like this:
Emp is a record of Employee variable.
you're welcome