Hi
I want to merge two textfiles via. Navision and have done it so far by writing a SHELL command:
SHELL('cmd','/C','copy '+File1+'+'+File2 +' '+NewFile);
Can't you do this without using the SHELL command?
When the two files are merged it also seems that a (It looks like an arrow pointing right in a binary texteditor) appears at the end of the new file. Why is that? and how do you get rid of it?
Have tried:
FileVar.OPEN(NewFile);
FileVar.SEEK(FileVar.LEN-1);
FileVar.TRUNC;
Can someone help me?
Thanks
/H.
Comments
FileID.WRITEMODE(TRUE);
FileID.TEXTMODE(FALSE);
FileID.OPEN(FullExportFilename);
FileID.SEEK(FileID.LEN-1);
FileID.TRUNC;
FileID.CLOSE;
1) copy the file first file to the new file with FILE.COPY
2) open the new file with a FILE variable
3) open the second file with a FILE variable
4) read the lines of the second file and write them to the new file
I think if the strange character was there in the input files only then it will occur in the output (new) file? Are the files text only?
Grtz.
Remco
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thanks for your replies.
I've at long last solved it...
I had to use the SHELL command but the reason why I couldn't get the TRUNC function to work was simply because the system couldn't copy the files fast enough before executing the rest of the code, so I had to put in a SLEEP right after the SHELL command... it took me pretty long time to figure that out :-)
Thanks again