Search Results

Search: Posts Made By: blakeoft
1,841
Posted By blakeoft
Try this one: cat file | tr '\n' '$' | sed 's/$...
Try this one:
cat file | tr '\n' '$' | sed 's/$ / /g' | tr '$' '\n' | awk '$1 == "initiators" {print}'Note that this assumes that "$" does not appear in your text. If it...
2,142
Posted By blakeoft
I'm not quite sure I understand your question....
I'm not quite sure I understand your question. Are you wanting to be able to find the slope and R squared for each row if the x values aren't always 0, 3, 6 and 10?
2,810
Posted By blakeoft
Try this then: FOLDER="/nas/testfolder" ...
Try this then:

FOLDER="/nas/testfolder"
FILE=$(ls -alt ${FOLDER} | awk '$NF ~ /^Test/ {print $NF}' | head -1)
if [[ -z $FILE ]]
echo "No file name matches your pattern in $FOLDER"
else
...
1,423
Posted By blakeoft
I'm not quite sure I understand. Are you trying...
I'm not quite sure I understand. Are you trying to print the first column of the first entry whose third and fourth columns are 00:00:01 and acroread, respectively?

Edit: To add to RudiC's answer:...
2,810
Posted By blakeoft
I think I have a fix for my code above. Try this:...
I think I have a fix for my code above. Try this:
FOLDER="/nas/testfolder"
FILE=$(ls -alt ${FOLDER} | awk '$NF ~ /^Test/ {print $NF}' | head -1)
FILE_TIME=$(date --reference=$FOLDER/$FILE +%s)...
2,810
Posted By blakeoft
Try this: ls -al | awk '$NF ~ /pattern/...
Try this:

ls -al | awk '$NF ~ /pattern/ {print $7,$8,$9}' | sort -rM | head -1Long list of all files in the current directory showing hidden files. Pipe to awk. If the last field (the file names)...
2,733
Posted By blakeoft
Jethrow's code worked for me, but I couldn't copy...
Jethrow's code worked for me, but I couldn't copy and paste the whole thing at once. When I copied line by line it ran and gave me:

#User@Host:xyz@[ipaddress] | Query_time: t1 | Lock_time: t2 |...
2,142
Posted By blakeoft
I can help you digest it. I honestly meant to...
I can help you digest it. I honestly meant to explain every solution that I post on this site.

Most of the stuff before "if (denomy != 0)" are just variables that are used to calculate the slopes...
2,142
Posted By blakeoft
Sorry if this looks awful. It seems to work...
Sorry if this looks awful. It seems to work though.
>awk '{sumy=$2+$3+$4+$5} {sumxy=$3*3+$4*6+$5*10} {sumy2=$2*$2+$3*$3+$4*$4+$5*$5}
{denomy=(4.0*sumy2-sumy*sumy)}...
2,142
Posted By blakeoft
This will get you the slope of the least squares...
This will get you the slope of the least squares line.
>awk '{sumy=$2+$3+$4+$5} {sumxy=$3*3+$4*6+$5*10} {print $1,$2,$3,$4,$5,(4.0*sumxy-19*sumy)/(4.0*145-361)}' file.txt
t1 2 3 5 8 0.611872
t2 0...
2,142
Posted By blakeoft
I'm assuming that you want the gradient of the...
I'm assuming that you want the gradient of the best fit line. Is that correct?
2,446
Posted By blakeoft
Can you post a sample of file1.txt? Backticks ( `...
Can you post a sample of file1.txt? Backticks ( ` ) execute what is between them first. Since XYZ is not a command, you might have to escape the command, i.e. put a \ in front of each backtick. See...
Forum: War Stories 04-02-2014
19,512
Posted By blakeoft
What a strange problem. I'm also surprised that...
What a strange problem. I'm also surprised that the stats department was able to discover the ~500 mile limitation.
Showing results 1 to 13 of 13

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