CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   How to put point coordinates between braces? (https://www.cfd-online.com/Forums/openfoam-pre-processing/98415-how-put-point-coordinates-between-braces.html)

Attesz March 10, 2012 08:57

How to put point coordinates between braces?
 
Hi all,

I have 250 points to put into a file in OpenFOAM as coordinates. OF wants to have them between braces, but I have them in Libreoffice calc. Do you have idea how to do this automatically?

This question is more programming than CFD :)

Best,
Attila

olesen March 12, 2012 02:31

For these types of tasks, you should forget the excel/office-calc tools.
It is simpler to use standard unix tools such as awk/perl instead.
For example,
Code:

    awk '{ print "{" $0 "}" }' infile.txt
will print enclosing braces around each line.

Attesz March 12, 2012 02:58

Thank you, yes I know I should know much more about linux. However, I managed to do it in calc, it was quite easy, but your solution is more elegant.

Have a nice day,
Attila


All times are GMT -4. The time now is 15:24.