Options

Modification of content of a text file from Nav

MrinmayMrinmay Member Posts: 74
edited 2009-12-02 in NAV Three Tier
hi Expart,
i want to know how to modify the content of a text file from Navision. let me explain bit more....suppose 1 text file is there in c drive in client system called "test.txt". In that text file only one name is there for example ' XYZ ABC'.
Now i want to change the name as 'XMZ ARC' from Navision into that file.
Now my question is how to do that?

Thanks In Advance

Regards,
Mrinmay

Comments

  • Options
    BeliasBelias Member Posts: 2,998
    Search rename function in the F1 -online help of navision.
    If you are on RTC, also remember that you have to search also for UPLOAD and DOWLOAD functions: you have to upload the file on service tier in order to be able to rename it, and then download it on the client.
    EDIT: :-k i don't know if the file is renamed, or a new file with the new name is created...i've never done this... :-k
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    MrinmayMrinmay Member Posts: 74
    i Think rename will rename the file name. but i want to modify the content of the file. i want to do it from cassic client ony.
    i have written code like below:


    File1.TEXTMODE(TRUE);
    File1.WRITEMODE(TRUE);
    File1.OPEN('D:\Test.txt');
    File1.SEEK(1);
    File1.WRITE('P');
    File1.CLOSE;

    Note: Content of Test.txt is 'XYZ ABC' i want it 'XPY ABC'

    But it is not working properly. After running the code in file it coming like

    P
    ABC


    what to do so that after running it will give : XPY ABC
  • Options
    kinekine Member Posts: 12,562
    try TEXTMODE(FALSE). If you use TEXTMODE true, each WRITE is creating new line. If using binary mode, exactly what you use in the parameter is written into the file.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.