Hi Bong,
So there isn't a way to find the two nearest values to 0.25 in one iteration without replacing the value? I use the input file for making the geometry later on, so I rather don't change any values in it...
Any suggestions for this?
Thanks again, your input is helping me a lot!
Hi Bong,
Thanks, this solution works.
However I still only recieve the second result.
I think the solution is to split the first column in 2 parts.
The first one would be starting at the first line and end at the line having the values 0.0000 0.0000.
The second part would be the remainder of...
Hi Bong,
Thanks for your reply!
I am trying to run your code but I don't understand everything happening.
The $testx is empty when I check it. Is that normal?
Entries x=0.24502 and x=0.25498 can be found on lines 22 and 42 respectively, starting counting from 1.
Ideally I would the result as...
Hi Feherke,
Could it be there is an error in the "lassign" command?
Actually I am using ICEM CFD to run the tcl code since it is part of my script for the mesh generation.
Apparently this in an invalid command name according to ICEM.
Thanks!
Hi Feherke,
Thanks for your quick reply!
Actually I am not at all interested in the values. I want to know at which line numbers these values are found. Could it be that herefore a counter has to be included?
Do you understand what I mean?
Regards
Hi all,
I have a tcl/tk programming error. I have some experience in programming tcl/tk but this is very basic.
My problem is the following:
I have a .dat file with varying entries. In general the file looks as follows:
NACA6409 9%
1.00000 0.00000
0.99732 0.00084
0.98930...
Hi Mikrom,
That was exactly what I desired. Thanks for the help. If all is fine I should be able to finish the rest myself.
Thanks again for the great assistance!!!
Regards
Hi Mikrom,
Sorry I took a bit longer than expected to test the new code you provided.
I tried the new expression for regexp, but I think it's not working correctly yet.
My input file looks like:
naca 45356 9%
1.0 0.0
0.9 0.1
...
0.9 -0.1
1.0 0.0
The code you provided does the job up till the...
Hey Mikrom,
Again, thanks.
I'll try to check the result over the weekend. Since I don't have internet access this weekend I'll let you know on monday wether it works. But really thanks a lot for your help!!!
Have a nice week end!
Well all works almost fine now :D
The last thing to do is to delete the last line of the output file. This is since my input file are a bunch of airfoil coordinates. The first and last entry are exactly the same, creating hereby the same point twice. By deleting the last line this will be...
Hi Mikrom,
As usual you know the answer, thanks.
The piece of blue code you provided does the job. The input line consisted of several numebers and letters so they where processed in dataproc2.tcl. However using the blue code this problem is solved.
Thanks a lot!
Regards
Hi Mikrom,
A small last question, I promise :D! Due to circumstances my input file has changed format a bit.
Instead of starting direct with the coordinates on the first line of the input file there is a line of text (a combination of numbers and letters) which I want to delete.
Could you...
:D
I just thought of a second question, i'm sorry.
Considering my previous question, the $var4 value on the first line should actualy be the number of entries in a colum. I mean if there 20 values in the X-colum, the $var4 should be 20 and posted on the first line.
I'm not sure wether my...
Hi Mikrom,
You are a genius! Thanks a lot for the help! Now it's working perfectly.
I have one small question left, could you tell me how to put some text on the first line of the output file? For example assume there is a $var4, one value, and this needs to be placed on the first line of the...
Hi mikrom,
First of all, thanks for your reply.
You are right, I mean add Y coordinates instead of Z coordinates!
You understood correctly, I only made a mistake in the end, I want to end up with:
expr[1 + $var1] expr[$var2] expr[10 + $var3]
expr[2 + $var1] expr[$var2] expr[20 + $var3]
...
Hi all,
I'm currently scripting a icemcfd analysis with tcl/tk.
At a certain point I need to edit a .dat file (with x and z coordinates). Normal this is easy to achieve however I haven't succeeded yet doing this in tcl/tk.
The .dat file looks as follow:
X1 Z1
X2 Z2
. .
. .
...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.