How to modify an exist file with add one line string to definite line RRS feed

  • 问题

  • Hi friend,

    I am a trouble that add additional line into an existed file "MyTest.txt", the content of the file like this:


    function ms(){

     o.patchLogAndThrow("Windows.a",   "b");
     o.patchStaticLogAndThrow("Windowsc",    "d");
     o.patchLogAndThrow("Windows.x",     "x"); 



    Now I want to add one line " o.patchStaticLogAndThrow("Windows.g",    "d");" under the line with blankbody.

    And then save the file with the change. I can do other action with this change.

    Could some friends give me some suggestion or code example?

    • 已编辑 Jack_Zhu 2012年3月21日 7:45
    2012年3月20日 10:24