Hi All,
I am writing to have your advise on how to approach this task. I am quite new to Java and programming hence I ask help.
I need to write a file based on comma separated field where each line is defined by a semicolon. Most of the values in this file are constant i.e. there some fixed information that can be already stored in it. Other information need to be edited/added and will be variables.
For instance if you look at the attached txt it gives you an idea how the file I want to write need to be. ! or / Are comments and not processed. In this file fields are grouped in classes and every class has a constant name for instance if you go to line 668 Lights is the class of the objects described in that section. All fields of the class can be assigned by variables. Luckly there some information that will never change in my case so I need to edit just few yet important values.
In particular I ll need to edit some data from line 611 - this data is formatted like this:
Shading:Zone:Detailed,
Shading Device1, !- Name
Daylit South Wall, !- Base Surface Name
, !- Transmittance Schedule Name
4, !- Number of Vertices
0, !- Vertex 1 X-coordinate {m}
0, !- Vertex 1 Y-coordinate {m}
20, !- Vertex 1 Z-coordinate {m}
0, !- Vertex 2 X-coordinate {m}
-1.5, !- Vertex 2 Y-coordinate {m}
20, !- Vertex 2 Z-coordinate {m}
5, !- Vertex 3 X-coordinate {m}
-1.5, !- Vertex 3 Y-coordinate {m}
20, !- Vertex 3 Z-coordinate {m}
5, !- Vertex 4 X-coordinate {m}
0, !- Vertex 4 Y-coordinate {m}
20; !- Vertex 4 Z-coordinate {m}
so every field of this object is a variable that will passed from my program and written in this file. My question are:
- how do you would you approach this task and how would you organize data to be referenced?
- how do you write in a specific location in a file where there already some information stored? is it possible?
Thanks