package prob-when copying files

I write a program to copy one file from one package to another package.

In eclipse, file need to claim the package it is in rigorously.

e.g. in Package A I have test.java:

package A;

public class test( ){

..

}

If I want to move to package B, I also need to change the package name manually to

package B;

public class test( ){

}

In my program that copies the file from one package to another one, how can I change the package name specified in the file automatically?

Many thanks

[557 byte] By [evanling1980a] at [2007-10-2 23:35:00]
# 1
One way would be regexanother would be just plain search and replace of the first row that has package on it.The best way would be use the refactoring software that is already available and do that instead of reinventing the wheel.
darteda at 2007-7-14 16:17:02 > top of Java-index,Java Essentials,New To Java...
# 2
thanks.What is regex? is it a java package?also what available refactorying software is recommented for this particular task?
evanling1980a at 2007-7-14 16:17:02 > top of Java-index,Java Essentials,New To Java...