Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

I need some help.

od4honnor
2013-03-09
2013-03-09
  • od4honnor
    od4honnor
    2013-03-09

    Hello. I have a problem.

    I have a large text file with the following content.

    Object1

    ParameterA
    ParameterB
    ParameterC
    ...
    ParameterZ

    ObjectN

    ParameterA
    ParameterB
    ParameterC
    ...
    ParameterZ

    etc

    I want to change all the values of ParameterD in the entire text file.

    ParameterD Format:
    ParameterD 0, X1, X2, X3, X4, X5

    (ParameterD 0, 951, 317, 95, 95, 951
    ParameterD 0, 1134, 378, 113, 113, 1134
    ParameterD 0, 3000, 500, 50, 50, 2500
    ParameterD 0, 2000, 0, 0, 0, 0
    etc)

    What I want to get in the end?

    ParameterD 0, X1/5, X2/5, X3/5, X4/5, X5/5

    If - ParameterD 0, 3000, 500, 50, 50, 2500
    I want to get - ParameterD 0, 600, 100, 10, 10, 500

    I need help! Help! Help! )))

     
    Last edit: od4honnor 2013-03-09