Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Format Matrix Data - Fortran

  1. Aug 24, 2011 #1
    Hi

    I found this interesting forum and I hope you can help me.
    I have a. DAT file in which there are variables.
    Some variables must be copied into a new file and format.
    Attached the example of original file and an example of the output file.


    Example external file (115000 rows):

    01/05/2011; 1:00; città; col;col;var1; col;val1;val2;val3;val4;val5;val6;
    01/05/2011; 1:00; città; col;col;var2; col;val1;val2;val3;val4;val5;val6;
    01/05/2011; 1:00; città; col;col;var3; col;val1;val2;val3;val4;val5;val6;

    Example output:

    11 5 1 1 liv 0 val1 val1 val1 99 99
    11 5 1 1 liv 0 val2 val2 val2 99 99
    11 5 1 1 liv 0 val3 val3 val3 99 99
    11 5 1 1 liv 0 val4 val4 val4 99 99
    11 5 1 1 liv 0 val5 val5 val5 99 99
    11 5 1 1 liv 1 val6 val6 val6 99 99

    FORMAT (4(I2,1X), F6.1,1X, I1,1X, F5.0,1X, F7.2,1X, F7.1, 1X,F6.1, 1X,F7.2)

    where:

    col = Columns do not add
    var= variabile (temp;pressione etc);
    val= number
    liv= quote ;
    6 column in the output should be 0 0 0 0 0 1 with 1 as a terminal of the last value.

    Could you help me create a Fortran program able to format the data?

    Thanks
    baglieri
    Italy
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Format Matrix Data - Fortran
  1. Data fitting (Replies: 1)

  2. Data Processing (Replies: 5)

  3. Data Distribution (Replies: 7)

Loading...