Hi Padma,
There is probably a 'cleaner' way to do this, but this should work:
cat aseg.stats |grep -v '#'|sed 's/ \{1,\}/,/g'|sed 's/^,//'|sed 's/,$//' > aseg.csv
-Paul
From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of priya padma <priya@phenomx.ai>
Sent: Wednesday, October 26, 2022 9:36 PM
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] conversion of .stats to .csv
External Email - Use Caution
Dear Team,
I would like to convert the .stats files that are being generated in the stats folder as an output from recon-all to csv file or excel file. Is there any way to convert .stats to .csv or .excel format? any help on this would be much appreciated.
Thank you
--
Best Regards
Padma Priya
PhenoMx, Inc.