doubts related to disk files in C

A

Ameya

hello,
i have a very specific doubt related to file handling. My
objective is to make some modifications in the output data file of one
software which would be the input data file for another software.
Below is the output Data file in which i have to make some changes.

%% Version 3.0
%% VertexNumber: 129
%% EdgeNumber: 91
%% FaceNumber: 1
%% ElementNumber: 0
%% DO NOT CHANGE LINES ABOVE !!!!
% NET: Vertices <-> Edges <-> Faces <-> Elements
%
% Eingabefile ART3D: erstellt von Kluftgenerator FRAC3D
% Annette Hemminger,CAB,TU Braunschweig
%
% Vertices: x y z
0.00000 0.00000 0.00000
0.60000 0.00000 0.00000
0.60000 0.60000 0.00000
0.00000 0.60000 0.00000
0.11406 0.00000 0.00000
0.13623 0.00000 0.00000
0.17172 0.00000 0.00000
0.17628 0.00000 0.00000
0.35234 0.00000 0.00000
0.42312 0.00000 0.00000
0.53098 0.00000 0.00000
0.40753 0.60000 0.00000
0.35256 0.60000 0.00000
0.34731 0.60000 0.00000
0.25122 0.60000 0.00000
0.22941 0.60000 0.00000
0.22358 0.60000 0.00000
0.13107 0.60000 0.00000
0.06482 0.60000 0.00000
0.00289 0.60000 0.00000
0.00000 0.23049 0.00000
0.07409 0.33525 0.00000
0.06857 0.43509 0.00000
0.04289 0.28195 0.00000
0.02880 0.18295 0.00000
0.00727 0.48610 0.00000
0.00387 0.38616 0.00000
0.10471 0.52188 0.00000
0.09539 0.18428 0.00000
0.10806 0.27819 0.00000
0.23746 0.29384 0.00000
0.22926 0.36982 0.00000
0.47850 0.37484 0.00000
0.49267 0.47383 0.00000
0.35293 0.57271 0.00000
0.29944 0.26171 0.00000
0.29167 0.16202 0.00000
0.49368 0.26564 0.00000
0.50155 0.36533 0.00000
0.10515 0.07486 0.00000
0.09709 0.12485 0.00000
0.10515 0.07486 0.00000
0.09709 0.12485 0.00000
0.09061 0.02506 0.00000
0.18503 0.26558 0.00000
0.16258 0.16813 0.00000
0.58285 0.34703 0.00000
0.59228 0.44659 0.00000
0.56025 0.41951 0.00000
0.57424 0.32050 0.00000
0.21060 0.00746 0.00000
0.20343 0.10720 0.00000
0.11507 0.38269 0.00000
0.11456 0.28269 0.00000
0.51232 0.15172 0.00000
0.53373 0.24913 0.00000
0.47338 0.18218 0.00000
0.46663 0.28195 0.00000
0.22524 0.30633 0.00000
0.21203 0.40545 0.00000
0.21672 0.37023 0.00000
0.21633 0.20923 0.00000
0.23638 0.11126 0.00000
0.23230 0.45406 0.00000
0.22742 0.51884 0.00000
0.32956 0.02007 0.00000
0.32274 0.11983 0.00000
0.58261 0.39944 0.00000
0.57876 0.29951 0.00000
0.46648 0.34126 0.00000
0.44232 0.43830 0.00000
0.36446 0.10242 0.00000
0.36162 0.00246 0.00000
0.14272 0.45390 0.00000
0.12677 0.35518 0.00000
0.47332 0.10968 0.00000
0.47650 0.20962 0.00000
0.52630 0.08201 0.00000
0.59152 0.49841 0.00000
0.59598 0.59831 0.00000
0.01448 0.50344 0.00000
0.52076 0.12916 0.00000
0.49718 0.03198 0.00000
0.26603 0.18533 0.00000
0.29723 0.28034 0.00000
0.33174 0.53201 0.00000
0.34173 0.43251 0.00000
0.26201 0.42456 0.00000
0.22015 0.56173 0.00000
0.11859 0.15803 0.00000
0.11778 0.22939 0.00000
0.23468 0.49093 0.00000
0.22824 0.39114 0.00000
0.28036 0.29025 0.00000
0.22824 0.39114 0.00000
0.28036 0.29025 0.00000
0.27916 0.39025 0.00000
0.02009 0.04304 0.00000
0.00760 0.14225 0.00000
0.39418 0.43620 0.00000
0.41639 0.51644 0.00000
0.17622 0.03260 0.00000
0.35363 0.52087 0.00000
0.51207 0.33853 0.00000
0.35757 0.23854 0.00000
0.34344 0.13954 0.00000
0.37560 0.37198 0.00000
0.35782 0.27357 0.00000
0.11984 0.07864 0.00000
0.28973 0.38906 0.00000
0.28121 0.48869 0.00000
0.16234 0.04287 0.00000
0.32035 0.40507 0.00000
0.31809 0.50505 0.00000
0.20023 0.28605 0.00000
0.21598 0.18730 0.00000
0.42509 0.07592 0.00000
0.40316 0.03738 0.00000
0.36223 0.12862 0.00000
0.34065 0.05352 0.00000
0.58081 0.58628 0.00000
0.56766 0.48714 0.00000
0.09951 0.32115 0.00000
0.28002 0.51418 0.00000
0.25579 0.55976 0.00000
0.05520 0.53238 0.00000
0.12117 0.46587 0.00000
0.10676 0.36692 0.00000
0.00913 0.26798 0.00000
0.26997 0.22346 0.00000
0.28808 0.32180 0.00000
0.22742 0.41669 0.00000
0.20498 0.31924 0.00000
$
% Edges (Indices to List of Points):
1: 0 4
1: 4 5
1: 5 6
1: 6 7
1: 7 8
1: 8 9
1: 9 10
1: 10 1
2: 1 2
3: 2 11
3: 11 12
3: 12 13
3: 11 12
3: 12 13
3: 13 14
3: 14 15
3: 15 16
3: 16 17
3: 17 18
3: 18 19
3: 19 3
4: 3 20
4: 20 0
-1: 21 22
-2: 23 24
-3: 25 26
-4: 17 27
-5: 29 28
-5: 30 31
-6: 32 33
-6: 13 34
-7: 35 36
-8: 37 38
-8: 4 39
-9: 40 41
-10: 42 43
-11: 44 45
-12: 46 47
-13: 48 49
-14: 50 51
-15: 53 52
-16: 54 55
-17: 56 58
-18: 58 57
-18: 59 60
-19: 61 62
-20: 63 64
-20: 65 66
-21: 67 68
-22: 69 70
-22: 71 72
-22: 73 74
-23: 10 75
-24: 76 77
-25: 19 78
-26: 79 80
-27: 81 82
-28: 83 84
-29: 31 85
-30: 16 86
-31: 87 88
-32: 89 61
-33: 61 90
-34: 91 92
-35: 93 94
-34: 91 92
-35: 93 94
-35: 96 95
-35: 7 97
-36: 12 34
-37: 34 98
-37: 53 99
-38: 100 101
-38: 102 103
-39: 5 104
-40: 105 106
-41: 6 107
-41: 108 109
-42: 110 111
-43: 9 112
-43: 113 114
-44: 8 115
-44: 116 117
-45: 88 29
-46: 29 118
-47: 11 96
-48: 85 119
-49: 14 120
-50: 18 121
-51: 122 123
-52: 20 124
-53: 125 126
-54: 127 58
-55: 58 128
-56: 15 62
$
% Faces (Indices to List of Edges):
1: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
19 20
$



The file starts with the comments and ends with the $ sign. after
modification, i have to save the file in the same format as above.
The modifications to be done are as follows:
1. Add 4 new values of vertices for all the three coordinates and
increment the value of the remaining vertices by a certain value for
either X or Y coordinate.
2. Add 4 new values for edges 1 & 3 (2 each). For the remaining
values, only the values after the ":" are to incremented by 4.
for example: if the edge is as follows:
1: 0 4 then the new value should looke like 1: 4 8 and so on.
Same goes for the negative edges as well.
3. The 2nd operation is to be repeated for Faces as well with the only
change that 2 new values are to be added.

Note: the comments on the top & in between are to be written as it is.

Please give me the solution for the abovementioned problems. I would
be grateful to you.
Thankyou in advance.
 
C

Charlie Gordon

Ameya said:
hello,
i have a very specific doubt related to file handling. My
objective is to make some modifications in the output data file of one
software which would be the input data file for another software.
Below is the output Data file in which i have to make some changes.

No problem: have no doubt about the fact that here is not the place to ask.
 
R

Randy Howard

hello,
i have a very specific doubt related to file handling.

s/doubt/question For some reason, this is the most misused
word in this group non-native English speakers.

[huge snip]
Please give me the solution for the abovementioned problems. I would
be grateful to you.
Thankyou in advance.

Sorry, but do your own homework. Everybody else had to do it on their
own. You'll be glad you did someday.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top