CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   How to put point coordinates between braces? (

Attesz March 10, 2012 09: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 :)


olesen March 12, 2012 03: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,

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

Attesz March 12, 2012 03: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,

All times are GMT -4. The time now is 02:11.