You are here: PSPad forum > English discussion forum > Re: Insert text into a specific position regardless of the line length

Re: Insert text into a specific position regardless of the line length

#1 Insert text into a specific position regardless of the line length

Posted by: al8150 | Date: 2012-09-19 13:50 | IP: IP Logged

Hello

I wonder if you can advise me on the following issue that I have encountered.

I have 338,141 lines of data. Most of this data is in blocks of variable lengths and the line finishes at the end of the data.

I want to insert a single "A" into position 80 regardless of the line lenth - if that means adding in spaces then so be it.

I have tried most of the options in Edit/Line Manipulation - no luck.

I have also tried the old UltraEdit method of selecting a column and tring to paste into it - again no luck

Any ideas on how I can achieve this?

Al.

Options: Reply | Quote | Up ^


#2 Re: Insert text into a specific position regardless of the line length

Posted by: myf | Date: 2012-09-19 15:52 | IP: IP Logged

Somewhat dirty:

1) Make sure each line has enough whitespace, IE global regex replace of "$" for "(80 spaces)" (make sure you do not have "trim trailing spaces" on in settings

2) block selection (ctr+shift+c) at desired column form top to bottom

3) regex replace of "." for "a$0" within selection

4) optional, remove redundant spaces

Options: Reply | Quote | Up ^


#3 Re: Insert text into a specific position regardless of the line length

Posted by: vbr | Date: 2012-09-19 22:22 | IP: IP Logged

al8150:
...
I want to insert a single "A" into position 80 regardless of the line lenth - if that means adding in spaces then so be it.
...

Hi,
another possibility could be to use a simple macro a call it repeatedly on each line.
Make sure to check Settings: Editor (part 1): [x] Scroll past EOL and EOF

place the cursor at the required character position on the first line
Start recording a macro (Tools: Macro: Start/Stop recording ...):
Write A
press ARROW DOWN
press ARROW LEFT

Stop recording a macro.
Save macro under some name.

Use the Tools: Macro: Macro manager: Play x-times
(adjust the number of the lines, where the "A" should be inserted.)

(Well, I am not sure, this is much simpler than the previously suggested way, but anyway...)

hth,
vbr

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