On Friday, April 4, 2003, at 12:48 PM, David Iberri wrote:


At 4/3/2003 6:05 PM, [EMAIL PROTECTED] wrote:
ie I want to split up the array:

array: 12345123451234512345

to:

12345
12345
12345
12345

I can do this easily just by printing to the file up till the correct
line length (5) and then inserting a "\n" and starting a new line.

Now I want to essentially rotate the values by 90 degrees:

5555
4444
3333
2222
1111



Thanks for your speedy reply David.


But I should have been clearer...

The array: 12345123451234512345 is meant to represent value placings rather than the actual values I have.

The values in those placings are completely arbitrary.

ie my array (which I have read in from a separate text file as an array) may look like:

120 110 100 90 80 115 105 95 85 75 110 100 90 80 70 105 95 85 75 65 and it would be transformed to:

80 75 70 65
90 85 80 75
100 95 90 85
110 105 100 95
120 115 110 105

(If I have made no mistakes and noting that the neat 5 unit differences are not real). in other words all the nth values are written onto the 1st line, n-1 values onto the 2nd line etc

Sorry for the confusion.

tony







_______________________________________________________
Dr. Anthony P. Scott,
Computational Quantum Chemistry Gp,     Office Ph.:     61-2-6125-3573
Research School of Chemistry,           Dept. Ph.:      61-2-6125-3637
Australian National University,                 Fax:                    61-2-6125-0750
Canberra, ACT 0200,                             
AUSTRALIA.

E-mail:         [EMAIL PROTECTED]
_______________________________________________________



Reply via email to