Page 1 of 1

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

Posted: Mon Aug 18, 2008 8:49 pm
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.

Posted: Mon Aug 18, 2008 9:08 pm
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!

thanks

Posted: Mon Aug 18, 2008 10:03 pm
by rslotpole
AC,

Thanks for the quick response. Where do you learn about /n and other conventions?

Posted: Mon Aug 18, 2008 10:38 pm
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.

Posted: Mon Aug 18, 2008 10:45 pm
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.

very helpful

Posted: Tue Aug 19, 2008 1:30 pm
by rslotpole
thanks