You are here: PSPad forum > English discussion forum > Re: insert a text line each x lines in a txt file

Re: insert a text line each x lines in a txt file

#1 insert a text line each x lines in a txt file

Posted by: Esgrimidor | Date: 2014-06-22 15:24 | IP: IP Logged

insert a text line each x lines in a txt file

How can i insert a line with text in a txt file with a rule : by example each 15 lines of the original txt file.

By example :
insert "lapsus" each 15 lines while exist the corresponding line.

Best Regards

--
Nice program indeed

Options: Reply | Quote | Up ^


#2 Re: insert a text line each x lines in a txt file

Posted by: Esgrimidor | Date: 2014-06-22 16:18 | IP: IP Logged

And in reverse mode :

Delete a line every x lines

By example

x5

line 5
line 10
line 15
etc while .not. eof

Best Regards

--
Nice program indeed

Options: Reply | Quote | Up ^


#3 Re: insert a text line each x lines in a txt file

Posted by: pspad | Date: 2014-06-22 16:35 | IP: IP Logged

There are 2 ways:
Copy text to clipboard
Macro
1. record macro - move 15x down and paste text
2. let macro run any times you need
The same you can do for delete each 15th line

Script
write script using PSpad scripting. PSPad scripting uses Windows Scripting Host and you can use any scripting language what is supported and presented in your operating system. In default JScript and VBScript.

Options: Reply | Quote | Up ^


#4 Re: insert a text line each x lines in a txt file

Posted by: Esgrimidor | Date: 2014-06-23 10:37 | IP: IP Logged

Understood

Best Regards

--
Nice program indeed

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR