Jump to content


Photo

Rearranging a Text File.


  • Please log in to reply
1 reply to this topic

#1 vidyashankara

vidyashankara
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 23 June 2006 - 06:35 PM

I have the Following text file

1 A1 B1 C1 //first row in matrix 1
1 A2 B2 C2 //second row in matrix 1
1 A3 B3 C3 //third row in matrix 1
2 A1 B1 C1 //first row in matrix 2
2 A2 B2 C2 //2nd row in matrix 2
2 A3 B3 C3 //3rd row in matrix 2
3 A1 B1 C1 //first row in matrix 3
3 A2 B2 C2 //2nd row in matrix 3
3 A3 B3 C3 //3rd row in matrix 3

I want to rearrage it to
1 A1 B1 C1 A2 B2 C2 A3 B3 C3 //all the coordinates of matrix 1
2 A1 B1 C1 A2 B2 C2 A3 B3 C3  //all the coordinates of matrix 2
3 A1 B1 C1 A2 B2 C2 A3 B3 C3  //all the coordinates of matrix 3

How do i do this dynamically? There can be any number of matrices...


Thanks

#2 vidyashankara

vidyashankara
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 23 June 2006 - 07:09 PM

1 A1 B1 C1 1 A2 B2 C2 1 A3 B3 C3 //all the coordinates of matrix 1
2 A1 B1 C1 2 A2 B2 C2 2 A3 B3 C3  //all the coordinates of matrix 2
3 A1 B1 C1 3 A2 B2 C2 3 A3 B3 C3  //all the coordinates of matrix 3

Can atleast this be done? all the elements of the first 3 rows into the first line, second 3 rows into the second line?







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users