Search Results

Search: Posts Made By: Jahn
5,256
Posted By Jahn
Calculating Running Variance Using Awk
Hi all,

I am attempting to calculate a running variance for a file containing a column of numbers. I am using the formula variance=sum((x-mean(x))^2)/(n-1), where x is the value on the current...
1,677
Posted By Jahn
Not quite. "Correct" and "Error" refer to the...
Not quite. "Correct" and "Error" refer to the outcome that they received, not whether they made the right response or not. For example, in the last IMAGINE condition the participant makes an...
1,677
Posted By Jahn
Yes; in this example, I would expect the output...
Yes; in this example, I would expect the output to be:

IMAGINE condition: totalCorrect = 2, totalIncorrect = 1
RECALL condition: totalCorrect = 1, totalIncorrect = 0


Thanks,

-Jahn
1,677
Posted By Jahn
Using AWK to Calculate Correct Responses
Hello,

I am trying to count how many times a subject makes a correct switch or a correct stay response in a simple task. I have data on which condition they were in (here, labeled "IMAGINE" and...
2,836
Posted By Jahn
AWK Script For Merging Text Files
Hello,

I am trying to merge data from two text files. One file (File1) contains a listing of data which includes the trial number in Column 5, while the other text file (File2) contains what...
2,621
Posted By Jahn
Thanks, Yinyuemi! That worked just like I wanted...
Thanks, Yinyuemi! That worked just like I wanted it to.

One last question: I have been trying to execute this as a shell script, but the script "hangs" without returning any input. For example:...
2,621
Posted By Jahn
Awk Script Counting of Correct vs. Error Responses
Hello,

I have been trying to use an awk script to parse out correct and incorrect answers in a simple tab-delimited text file. I am trying to compare the user's response to the stimulus presented...
2,277
Posted By Jahn
Thanks Tytalus, that was exactly what I was...
Thanks Tytalus, that was exactly what I was looking for.
2,277
Posted By Jahn
Merging Adjacent Lines Using Gawk
Hi all,

I have a text file consisting of 4 columns. What I am trying to do is see whether column 2 repeats multiple times, and collapse those repeats into one row. For example, here is a snippet...
11,775
Posted By Jahn
I get the following error: awk: jahn.awk:3:...
I get the following error:

awk: jahn.awk:3: fatal: split: second argument is not an array

Does 1A in this example need to be initialized as an empty array?

Thanks,

-Jahn
13,807
Posted By Jahn
Printing Field with Delimiter in AWK/cut
Hello,

I had posted earlier about printing fields using AWK, but now I have a slightly different problem. I have text files in the format:

1*2,3,4,5

and wish to print the first, third, and...
11,775
Posted By Jahn
Is there a way to do it from command mode? i.e.,...
Is there a way to do it from command mode? i.e., increase line position by two, delete two lines, increase line position, etc.

Thanks,

-Jahn
11,775
Posted By Jahn
Deleting every other Line in VI
Hello,

How would one delete every other two lines using VI? For example, I have the following 8 lines:

Line1
Line2
Line3
Line4
Line5
Line6
Line7
Line8

And wish to only delete lines...
3,200
Posted By Jahn
Here is what worked for me: foreach f (*) ...
Here is what worked for me:
foreach f (*)
awk -F'*' '{print $1}' $f > {$f}_temp
mv {$f}_temp $f
end

I have tried using the "awk code < file > newfile" redirection before, but I always end up...
3,200
Posted By Jahn
Using AWK in a for loop
Hello,

I am trying to use AWK to print only the first field of numerous text files, and then overwrite these files. They are of the format 1*2,3,4,5. I have tried the following code (using...
1,334
Posted By Jahn
Printing First Three Fields
Hello,

I have several files in the following format:

1*2,3,4,5

And I wish to only print the first three fields, including the special characters '*' and ','. I have used awk to print fields...
2,848
Posted By Jahn
Swapping in VI editor
Hi,

I am attempting to replace several similar words with another word in vi. Here is what I have written for the script:

3dTcat -prefix SuperBrik_4WAY_HRF...
3,578
Posted By Jahn
Problems opening GLUT
Hi there,

I realize this may not be directly related to Unix, but I have recently been using an fMRI analysis program called FreeSurfer which is primarily run in the tclsh shell. However, I have...
Showing results 1 to 18 of 18

 
All times are GMT -4. The time now is 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy