\i Replacement String not working?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
JohnFoelster
Posts: 9
Joined: Wed Nov 19, 2025 6:36 pm

\i Replacement String not working?

Post by JohnFoelster »

I am trying to use a RegEx replacement string in TextPad 8.5.1 to append row ID numbers to the beginning of each line of a fairly large tab delimited text file to prepare it for insertion into a SQL database.

The RegEx search condition is:

Code: Select all

^
The Replacement string is:

Code: Select all

\i{1342854,1,0,}\t
What I think it SHOULD be doing is numbering each row:

Code: Select all

1342854{tab}
1342855{tab}
1342856{tab}
and so on...

What I am in fact getting is:

Code: Select all

1{1342854,1,0,}{tab}
2{1342854,1,0,}{tab}
3{1342854,1,0,}{tab}
and so on...

And this is NOT what I want.

I remember \i working fine the last time I used TextPad to do this, and I don't think the last two parameters of the \i function were included in the Replacement String documentation the last time I did. I have no idea what I'm doing wrong.

I'm going to eat lunch and take a walk and hopefully someone will come by and explain why I'm stupid.
Last edited by AmigoJack on Wed Nov 19, 2025 11:26 pm, edited 1 time in total.
Reason: formatting code as code
User avatar
bbadmin
Site Admin
Posts: 1020
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: \i Replacement String not working?

Post by bbadmin »

You haven't specified the leading space character after the trailing comma. Either insert a space after it or delete the comma.
JohnFoelster
Posts: 9
Joined: Wed Nov 19, 2025 6:36 pm

Re: \i Replacement String not working?

Post by JohnFoelster »

Oh.

That was easy.

Thank you!
Post Reply