Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. anorky

    Search for nearest value in .dat file

    Hi Guys, Thanks for the replies and help. I figured it out :) Regards
  2. anorky

    Search for nearest value in .dat file

    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!
  3. anorky

    Search for nearest value in .dat file

    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...
  4. anorky

    Search for nearest value in .dat file

    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...
  5. anorky

    Search for nearest value in .dat file

    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!
  6. anorky

    Search for nearest value in .dat file

    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
  7. anorky

    Search for nearest value in .dat file

    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...
  8. anorky

    Data file editing with tcl/tk

    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
  9. anorky

    Data file editing with tcl/tk

    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...
  10. anorky

    Data file editing with tcl/tk

    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!
  11. anorky

    Data file editing with tcl/tk

    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...
  12. anorky

    Data file editing with tcl/tk

    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
  13. anorky

    Data file editing with tcl/tk

    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...
  14. anorky

    Data file editing with tcl/tk

    Hi Mikrom, That whas exactly what I wanted to achieve. Your help has saved me a lot of time... Thanks a lot! Regards
  15. anorky

    Data file editing with tcl/tk

    :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...
  16. anorky

    Data file editing with tcl/tk

    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...
  17. anorky

    Data file editing with tcl/tk

    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] ...
  18. anorky

    Data file editing with tcl/tk

    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 . . . . ...

Part and Inventory Search

Back
Top