Example 17
Write["example17"]
GIVEN: A data file named example16.dat
REQUIRED: Write the data to a new file
SOLUTION: Use the built in function named Write
z = ReadList["example16.dat", Number, RecordLists->True]
example17 = OpenWrite["example17.dat"]
Write[example17, z];
Close[example17]
Example
{{0., 0.}, {0.5, 0.}, {1.25, 1.894}, {2.5, 2.615}, {5., 3.555}, {7.5,
4.2}, {10., 4.683}, {15., 5.345}, {20., 5.737}, {25., 5.941}, {30.,
6.002}, {40., 5.8}, {50., 5.294}, {60., 4.563}, {70., 3.664}, {80.,
2.623}, {90., 1.448}, {95., 0.807}, {100.,
0.126}, {95., -0.807}, {90., -1.448}, {80., -2.623}, {70., -3.664}, {60., \
-4.563}, {50., -5.294}, {40., -5.8}, {30., -6.002}, {25., -5.941}, {20., \
-5.737}, {15., -5.345}, {10., -4.683}, {7.5, -4.2}, {5., -3.555}, {2.5, \
-2.615}, {1.25, -1.894}, {0.5, 0.}}
Homework:
a. Write the output to a different directory
Please send questions or suggestions about this web page to beatnic@aset.psu.edu
ASET | ITS | Penn State
|