Release Automation

  • 1.  Update content in Text File

    Posted Aug 10, 2018 02:04 PM

    i have a scenario where i want to use Add Text to a File action to update content in same file,



  • 2.  Re: Update content in Text File

    Broadcom Employee
    Posted Aug 12, 2018 09:49 PM

    Hi Kumar,

     

    I'm not sure whether I understand your requirement, but I share my verification.

     

    This is a text file. C:\work\a.txt

     

    Created 2 actions using [Add Text to a File] action type.

    First one is to add "aaa" after "111" with linefeed.

    Second one is to add "bbb" after "aaa" in same file.

     

    Set actions to a process like following, and run.

    And then, insert "aaa" and "bbb" to the file.

     

    I hope you can clarify regarding this action type.

    If this info is not enough for you, please share the detail of your requirement.

     

    Thanks

    Yas



  • 3.  Re: Update content in Text File

    Posted Aug 13, 2018 06:27 AM

    Hello Yasuyuki,

    we are creating some .dat files here and we want to give run time values in those files, If we use Add text to a file action after create .dat file action (mentioned in below snapshot), same value is updating in each .dat file.



  • 4.  Re: Update content in Text File

    Broadcom Employee
    Posted Aug 13, 2018 09:30 AM

    Hello,

     

    The values as shown by Yas were hard coded. But you can easily use parameters with values you get elsewhere (whether it be via user prompt, environment/release parameters, extracted from other files, etc..). 

     

    The part I wasn't clear on is whether you wanted to add content to a file - like Yas shows where he added aaa after 111. Or, did you want to replace 111 with aaa. If you want to replace then I think there are some actions that will do that as well. Also, if replacement is what you need then you might want to consider using Tokens.

     

    Kind regards,

    Gregg