AnsweredAssumed Answered

vrf File output question

Question asked by bwalden on Dec 31, 2002
Hi folks,

I have a simple problem and I'm sure I'm overlooking a simple solution
but .....

I have a file containing multiple lines of space delimited data - I do
not know how many data items each line contains but the number is
consistent for each file.  I want to read the file, modify one of the
data items in each line and then write the file back to the disk using
the original line oriented format.  Reading and modifying has not been a
problem; I end up with a 2D array of data items.  However, returning
them to a file having the same format as the original seems overly
difficult, particularly because I don't know the number of lines and the
number of items per line in advance.  What have I missed?

File entry:
123.4   5.6  00.0 12
123.6   5.7  00.1 12
123.5   5.7  00.3 12

Modified array:
[[123.4 5.6 10.0 12][123.6 5.7 10.1 12][123.5 5.7 10.3 12]]

My new file having the wrong format:
123.4
5.6
10.0
12
123.6
5.7
10.1
12
123.5
5.7
10.3
12

Barrie

---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes