andremincos
Technical User
Hi everybody,
Can anyone help me to fix my TCL script as below;
##########################################
while { [ gets $open_file line ] != -1 } {
set linerows [join $line ", "]
puts $out_file $strings$linerows
}
##########################################
The questions is;
1. Replace space become delimiter ", " (done)
1. Put numbers into column A
2. How to move the original data for
- column A move to column E
- column E become column F
The original data as follow;
C1010184 1.421 -1.865 16.580 DEFAULT
C1010185 0.158 -3.112 16.453 DEFAULT
C1010186 -0.111 -2.139 16.642 DEFAULT
C1010187 1.175 -2.241 16.339 DEFAULT
C1010188 0.203 -2.778 16.520 DEFAULT
C1010189 1.343 -4.008 16.279 DEFAULT
C1010190 -0.063 -1.819 16.698 DEFAULT
C1010191 0.588 -2.531 16.340 DEFAULT
C1010192 1.086 -3.597 16.353 DEFAULT
C1010193 0.181 -1.676 16.715 DEFAULT
C1010194 1.943 -3.280 16.330 DEFAULT
C1010195 0.299 -2.095 16.643 DEFAULT
C1010196 1.604 -1.797 16.565 DEFAULT
C1010197 -0.048 -2.231 16.626 DEFAULT
I wish the resulted as below;
1, 1.421, -1.865, 16.58, C1010184, DEFAULT
2, 0.158, -3.112, 16.453, C1010185, DEFAULT
3, -0.111, -2.139, 16.642, C1010186, DEFAULT
4, 1.175, -2.241, 16.339, C1010187, DEFAULT
5, 0.203, -2.778, 16.52, C1010188, DEFAULT
6, 1.343, -4.008, 16.279, C1010189, DEFAULT
7, -0.063, -1.819, 16.698, C1010190, DEFAULT
8, 0.588, -2.531, 16.34, C1010191, DEFAULT
9, 1.086, -3.597, 16.353, C1010192, DEFAULT
10, 0.181, -1.676, 16.715, C1010193, DEFAULT
11, 1.943, -3.28, 16.33, C1010194, DEFAULT
12, 0.299, -2.095, 16.643, C1010195, DEFAULT
13, 1.604, -1.797, 16.565, C1010196, DEFAULT
14, -0.048, -2.231, 16.626, C1010197, DEFAULT
Thanks in advance
Regards,
Andre
Can anyone help me to fix my TCL script as below;
##########################################
while { [ gets $open_file line ] != -1 } {
set linerows [join $line ", "]
puts $out_file $strings$linerows
}
##########################################
The questions is;
1. Replace space become delimiter ", " (done)
1. Put numbers into column A
2. How to move the original data for
- column A move to column E
- column E become column F
The original data as follow;
C1010184 1.421 -1.865 16.580 DEFAULT
C1010185 0.158 -3.112 16.453 DEFAULT
C1010186 -0.111 -2.139 16.642 DEFAULT
C1010187 1.175 -2.241 16.339 DEFAULT
C1010188 0.203 -2.778 16.520 DEFAULT
C1010189 1.343 -4.008 16.279 DEFAULT
C1010190 -0.063 -1.819 16.698 DEFAULT
C1010191 0.588 -2.531 16.340 DEFAULT
C1010192 1.086 -3.597 16.353 DEFAULT
C1010193 0.181 -1.676 16.715 DEFAULT
C1010194 1.943 -3.280 16.330 DEFAULT
C1010195 0.299 -2.095 16.643 DEFAULT
C1010196 1.604 -1.797 16.565 DEFAULT
C1010197 -0.048 -2.231 16.626 DEFAULT
I wish the resulted as below;
1, 1.421, -1.865, 16.58, C1010184, DEFAULT
2, 0.158, -3.112, 16.453, C1010185, DEFAULT
3, -0.111, -2.139, 16.642, C1010186, DEFAULT
4, 1.175, -2.241, 16.339, C1010187, DEFAULT
5, 0.203, -2.778, 16.52, C1010188, DEFAULT
6, 1.343, -4.008, 16.279, C1010189, DEFAULT
7, -0.063, -1.819, 16.698, C1010190, DEFAULT
8, 0.588, -2.531, 16.34, C1010191, DEFAULT
9, 1.086, -3.597, 16.353, C1010192, DEFAULT
10, 0.181, -1.676, 16.715, C1010193, DEFAULT
11, 1.943, -3.28, 16.33, C1010194, DEFAULT
12, 0.299, -2.095, 16.643, C1010195, DEFAULT
13, 1.604, -1.797, 16.565, C1010196, DEFAULT
14, -0.048, -2.231, 16.626, C1010197, DEFAULT
Thanks in advance
Regards,
Andre