Page 1 of 1

Help with reformatting lines of code

Posted: Wed Aug 27, 2003 2:32 pm
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?

Posted: Wed Aug 27, 2003 3:40 pm
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.