Insert contents of one file into a specific area of another file and saving it

Welcome Forums General PowerShell Q&A Insert contents of one file into a specific area of another file and saving it

Viewing 1 reply thread
  • Author
    Posts
    • #237250
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      I am a newbie to powershell and I am looking to merge contents of one file into another file

      I have 2 files I want to merge the contents

      Open 1st file named “config.xml”  find Text “trigger”

      Insert contents of second file “triggerInfo.txt” into “config.xml” after the word “trigger”

      Overwrite modified file “config.xml”

      any help would be appreciated

    • #237253
      Participant
      Topics: 5
      Replies: 2373
      Points: 6,011
      Helping Hand
      Rank: Community MVP

      Pete, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

      This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

      What have you tried so far? We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

      I did a quick research for. Here are some links to start with:

      Working with XML

      Working with XML Files in Powershell [Parsing]

      PowerShell Data Basics: XML

      Working with XML Files

      …. abd there are countless examples more out there. 😉

Viewing 1 reply thread
  • You must be logged in to reply to this topic.