Help with reformatting lines of code

General questions about using TextPad

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

Post Reply
Ed
Posts: 103
Joined: Tue Mar 04, 2003 9:09 am
Location: Devon, UK

Help with reformatting lines of code

Post by Ed »

I have code that looks like this in a number of files:-

Code: Select all

    Info
        (
            "something\n", 
            xyz
        ); 
I want to put it all one one line :

Code: Select all

    Info("something\n",  xyz); 
The key things are it starts with Info and ends with ;
I think I want a macro to operate over all the files and use Ctrl-J, however, there are some cases where it is already on one line and Ctrl-J appends the line following the ;

I think that's a bug with Ctrl-J (I'll report that separately).
Any ideas?
User avatar
talleyrand
Posts: 625
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

You might be better served with a regular expression. I'm no regexp guru otherwise I'd throw out a sample. If no one else kicks one out, I'll try it after work.
Post Reply