History of AFNI updates  

|
Colm Connolly
August 21, 2009 05:36AM
Hi Rob,

You may be able to avoid the excel2txt program by exporting the excel sheet as a comma separated value (CSV) file.

You could then set the field separator in awk to extract the columns

#!/bin/bash

for i in 31 32 34 37; do
for j in 1 2 3 4 6 7; do

cat $i.csv | awk 'BEGIN { FS = "," } ; { print $'$j'}' > $i.$j.1D

done
done

If your lines (aka records) do not end in newline characters you can change it by specifying a custom record separator. For example, awk 'BEGIN { FS = "," ; RS="\r" } ; { print $'$j'}' > $i.$j.1D which I think should work, though I've not tried it.

Bye,

Colm.
Subject Author Posted

1dCat use

Rob Hester August 20, 2009 08:01PM

Re: 1dCat use

rick reynolds August 20, 2009 09:27PM

Re: 1dCat use

Rob Hester August 20, 2009 09:39PM

Re: 1dCat use

rick reynolds August 20, 2009 10:37PM

Re: 1dCat use

Rob Hester August 21, 2009 02:14AM

Re: 1dCat use

Rob Hester August 21, 2009 03:17AM

Re: 1dCat use

Colm Connolly August 21, 2009 05:36AM

Re: 1dCat use

Colm Connolly August 21, 2009 05:38AM

Re: 1dCat use

Rob Hester August 21, 2009 07:02AM

Re: 1dCat use

Rob Hester August 26, 2009 12:42AM