Friday, 24 August 2018

How to sort list of files to pass in a loop


for f in $(ls bar*.out | sort -V); do
echo $f
grep "text" $f | tail -n1
done > text.csv

This is useful only for a single coloumn. What if one coloumn is extracted (in something)? There will be N number of coloumns. How to save this in csv file, with each coloumn in different coloumn of a CSV file?


No comments:

Post a Comment

Reason for the Maximum index for Augmentation-charges (SET IRDMAX)" error in OUTCAR file: VASP Calculation.

 "The Maximum index for Augmentation-charges (SET IRDMAX)" error is most-likely due to parallelization issues.  To check this, try...