How to break line in a .txt file using C# after finding a paarticular text

  • Thread starter Thread starter rrfatesingh
  • Start date Start date
R

rrfatesingh

Guest
I have a file abc.txt which contains data like below ..

/* ----------------- test_cmd ----------------- */


insert_job: test_cmd job_type: CMD
command: C\:\temp\test.exe
machine: abc.com
permission: gx,wx,mx
date_conditions: 0
timezone: EST5EDT
application: MyApp

/* ----------------- test1_cmd ----------------- */

insert_job: test1_cmd job_type: CMD
command: C\:\temp\test1.exe
machine: abc.com
permission: gx,wx,mx
date_conditions: 0
timezone: EST5EDT
application: MyApp


I want to brek the line (which contains job_type) into 2 line and my output file (abc.txt) should contain data like below ..


/* ----------------- test_cmd ----------------- */

insert_job: test_cmd
job_type: CMD
command: C\:\temp\test.exe
machine: abc.com
permission: gx,wx,mx
date_conditions: 0
timezone: EST5EDT
application: MyApp

/* ----------------- test1_cmd ----------------- */

insert_job: test1_cmd
job_type: CMD
command: C\:\temp\test1.exe
machine: abc.com
permission: gx,wx,mx
date_conditions: 0
timezone: EST5EDT
application: MyApp

Continue reading...
 
Back
Top