AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
January 25, 2018 08:46AM
A possible solution is the Unix command line utility 'cut'. For example, if file fred.txt is
1 2 3 4 5 6 7
1 2 3
1 2 3 4 5
Then the command
cut -f 1,3,5,7,9 -d ' ' fred.txt
produces (to stdout) the results
1 3 5 7
1 3
1 3 5
That's the odd numbered columns, separated by the space ' ' character (up to column #9). By putting in at least as many column indexes after the '-f' option as there are actual columns, you can pick out what you want. You can use the AFNI 'count' utility for this purpose, as in
cut -d ' ' -f `count -dig 1 -comma 1 99 2` fred.txt
Here, the backquote operator `count ...` means "run the command inside the backquotes, capture the stdout and put it on the command line here". If you try the given count command by itself, you get
count -dig 1 -comma 1 99 2
1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99
For the even columns, use 'count -dig 1 -comma 2 100 2' instead. Note that the option -d ' ' is needed since the default separator for 'cut' is the tab character, so if you used spaces, then each line is considered to be one big column and you won't like the results. Obviously, you need to test the results to make sure they work with your files!
Subject Author Posted

split half-ing with timing_tool?

jmjarcho January 25, 2018 02:48AM

Re: split half-ing with timing_tool?

Bob Cox January 25, 2018 08:46AM

Re: split half-ing with timing_tool?

jmjarcho January 28, 2018 02:38PM

Re: split half-ing with timing_tool?

rick reynolds January 25, 2018 01:28PM

Re: split half-ing with timing_tool?

jmjarcho January 28, 2018 02:41PM