swapping the contents of the file and writing to another file
i have a problem
i have to read contents from the file and my input file1.txt is like this
G101 G102 G104 G105 G109
G178 788 832 736 534
G103 645 623 937 435
G925 724 693 024 087
G510 123 627 802 510
and my output file should be like this
G101 G178 G103 G925 G510
G102 788 645 724 123
G104 832 623 693 627
G105 736 937 024 802
G109 534 435 087 510
the logic behind the problem is to keep the diagonal elements as such as and replace the other elements by storing it in a temporary variables and swapping them (ie)(0,1) should be swapped to (1,0) and so on..
so i started with reading a each line from the input file..but i need to read each and every element and store it in a two dimensional array..
public static void main(String args)throws IOException
FileInputStream in=new FileInputStream("File1.txt");
BufferedReader br=new BufferedReader(new InputStreamReader(in));
String myarray=new String;
for (int i=0;i<myarray.length;i++)
can someone plz help me in solve this problem...