Inserting Text in File

I’m looking for the most efficient way to insert some text into an existing text file. I need to modify an ini file to include text under a particular area. I can think of one way to do it using read text file and searching for the text I want to insert after but it seems like a pretty roundabout way of doing it. Any ideas?

Something I forgot: I know I can use the Write INI File action but I actuall have a whole block of text I need to write to the ini file. Using a seperate action for each value I want to write would be cumbersome. I just want to insert a block of text into a particular location.

Hi Larry,

When you say a “whole block of text” do you mean a list of name=value pairs?

If you have them each in individual variables, you can use the “Save Variables to INI File” action. Otherwise, you’re stuck with either writing each value with Write Ini File, or using Read Text File, Text Replace, then Write Text file.

Regards,


Angus

I am begineer …i have text file…i have read the content from text file and assigned to variable …i want insert the assigned values to another text file…

Hi Velu,

You’ll need to use the ‘Write to Text File’ action with the content as %MyVariable% (where MyVariable is the name of your variable).

Regards,
Paul.