New Reply

Creating 2-d array from a text file in fortran

 
Share Thread Thread Tools
Jun21-12, 05:14 PM   #1
 

Creating 2-d array from a text file in fortran


I have a text file of the format

x1 y1
x2 y2
. .
. .
. .

I need to read this into an array. How is this done in Fortran?
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Ants and carnivorous plants conspire for mutualistic feeding
>> Forecast for Titan: Wild weather could be ahead
>> Researchers stitch defects into the world's thinnest semiconductor
Jun21-12, 07:59 PM   #2
 
you start by declaring a couple of array variables long enough to accommodate your values.
then, you open the file
write a do-loop
read values into array with the loop variable as the index


If I tell you more, I will be writing more than what it takes to simply write the code and give it to you.

with those hints, go ahead and take a shot at it, don't be shy, write some code and see what happens....you are not going to break anything nor set the room on fire or anything...that's what so wonderful about software!
New Reply

Tags
array, fortran, matrix
Thread Tools


Similar Threads for: Creating 2-d array from a text file in fortran
Thread Forum Replies
Transfering data from a text file into a 2D vector array in c++ Engineering, Comp Sci, & Technology Homework 2
Read array from a file in Fortran Programming & Comp Sci 4
Fortran 90 creating an array of unknown size Programming & Comp Sci 3
Getting fortran to read a text file and write the whole file to a different location Programming & Comp Sci 4
Fortran: creating array containing characters Programming & Comp Sci 1