how to set block on specific column or append comma to every

General questions about using TextPad

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

Post Reply
rslotpole
Posts: 7
Joined: Fri Sep 30, 2005 9:33 pm

how to set block on specific column or append comma to every

Post by rslotpole »

Hi,

I'm new to textpad and not sure how to issue any user base commands. Is there an easy way to mark a specific column over 300,000 lines/records. Scrolling through the file is not really a viable option. Alternatively, I'm just trying to add a comma (',') at the end of every line. Could someone provide step by step instructions on how to issue a comand to do this - is there a user manual??

Thanks for your help.
ACRobin
Posts: 134
Joined: Fri Nov 04, 2005 9:51 pm
Location: Northumberland,UK
Contact:

Post by ACRobin »

Easy to add your ","

Just use the find and replace.

type "/n" in the find (without quotes)

type ",/n" in the replace

tick "regular expression" box

click "replace all"

That should be that.

Yes there is a manual/on line help - it is in the same place as many windows application!
rslotpole
Posts: 7
Joined: Fri Sep 30, 2005 9:33 pm

thanks

Post by rslotpole »

AC,

Thanks for the quick response. Where do you learn about /n and other conventions?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

It's not /n ; it's \n .

And simpler is:
Find what: $
Replace with: ,

[X] Regular expression

Replace All
$ means match at the end of a line.

Look in TextPad's help under
Reference Information | Regular Expressions,
Reference Information | Replacement Expressions and
How to... | Find and Replace Text | Use Regular Expressions.

There are many regular expression tutorials on the web, and you will find recommendations for some of them if you search this forum.

A standard reference for regular expressions is

Friedl, Jeffrey E F
Mastering Regular Expressions, 3rd ed
O'Reilly, 2006
ISBN: 0-596-52812-4
http://regex.info/

But be aware that the regular expression recogniser used by TextPad is very weak compared with modern tools. So you may get frustrated if you discover a handy trick that works elsewhere but doesn't work in TextPad.
ACRobin
Posts: 134
Joined: Fri Nov 04, 2005 9:51 pm
Location: Northumberland,UK
Contact:

Post by ACRobin »

oops true "\n" - sorry.

But yes, Ben your example is simpler.

Regular expressions are covered in the help, but just scratches the surface.

If you surf the net I am sure there must be a tutorial - well worth learning or searching this forum to see what you want to do has been answered before.
rslotpole
Posts: 7
Joined: Fri Sep 30, 2005 9:33 pm

very helpful

Post by rslotpole »

thanks
Post Reply