CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Problem: Export one colum of spreadsheet (https://www.cfd-online.com/Forums/paraview/126507-problem-export-one-colum-spreadsheet.html)

LiteCFD November 19, 2013 12:35

Problem: Export one colum of spreadsheet
 
Hi all!

I have problem with paraview results export;

After data load i use Contour filter. It's required for drawing free surface.

Then i try to export only coordinates of contour point:
- select necessary column from spreadsheet
- File -> Save Data.

But in result csv there are all arrays (P, U, alpha, etc)

Please help. What I'm doing wrong? May be I also should use another filter?

BTW, can I copy columns directly from spreadsheet view? Ctrl+C of Edit->Copy don't work.

Thanks a lot!

tomf November 20, 2013 02:58

Hi,

Usually I use some shell commands to modify the content. Something like this should work:

Code:

sed 's/,/ /g' <filename>.csv | awk '{print $1}' > column1.csv
Use $2 in the awk print part for column 2 of the csv file or if you want only columns 1 and 3, use:

Code:

sed 's/,/ /g' <filename>.csv | awk '{print $1 "," $3}' > column1and3.csv
This is more a workaround though.

Regards,
Tom

Bernhard November 20, 2013 03:02

The pipe from sed to awk seems obsolete if you could use the IFS input for awk. Anyhow:
Code:

cut -d',' -f1 <filename>.csv
would do the job too :)

arvhult March 18, 2014 09:19

Quote:

BTW, can I copy columns directly from spreadsheet view? Ctrl+C of Edit->Copy don't work.
I found that "file -> export scene" exports the actual selection in the spreadsheet view. It took way too much time to realize this...
This is ParaView 4.1.0 64-bit.

I share your opinion that a simple copy-paste functionality would be helpful!

Warm regards,
Carl-Magnus Arvhult

wyldckat March 21, 2014 17:03

@Carl-Magnus Arvhult: Many thanks for sharing your finding!

By the way, if anyone needs to do this in Python within ParaView: http://markmail.org/message/anlxxwlrlyacmsr6


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