Search Results

Search: Posts Made By: Board27
2,059
Posted By Aia
perl -nle 'print if ($_ <= 3060.00 && $_ >=...
perl -nle 'print if ($_ <= 3060.00 && $_ >= 2990.00)' file
perl -nle 'print unless ($_ > 3060.00 || $_ < 2990.00)' file

Output:
3000.66
2990.00
3060.00
3002.55
2,059
Posted By Scrutinizer
Try: awk -v min=2990 -v max=3060 '$1>=min &&...
Try:
awk -v min=2990 -v max=3060 '$1>=min && $1<=max' file
1,478
Posted By RavinderSingh13
Hello Board27, Could you please try...
Hello Board27,

Could you please try following and let me know if this helps you.(Change var's value to your needed line number)

awk -v DATE=$(date +"%H:%M") -v var=3 'FNR==var{print...
1,478
Posted By RavinderSingh13
Hello Board27, Could you please try...
Hello Board27,

Could you please try following and let me know if this helps you.

awk -v DATE=$(date +"%H:%M") -v var=3 'FNR%var==0{print $0,DATE;next} 1' Input_file
Here in above code I...
2,315
Posted By RudiC
Well, shooting in the dark, try while IFS=,...
Well, shooting in the dark, try
while IFS=, read NR SC; do [ "$NR" != "" ] && { ((NR+=100*(SC-${OLDSC:-$SC}))); OLDSC=$SC; echo $NR,$SC; } || echo; done < file
986
Posted By RudiC
Try (untested) awk 'NR == 1 {last = $1} {print...
Try (untested)
awk 'NR == 1 {last = $1} {print $0, $1 - last}'

If a value is an exact integer, awk strips decimals by default. Use printf in case you want decimals.
997
Posted By itkamaraj
perl -lane 'print ($F[1]+$F[2])*$F[3]' inputfile
perl -lane 'print ($F[1]+$F[2])*$F[3]' inputfile
997
Posted By Chubler_XL
Try: awk '{ printf "%f\n",$3*($1+$2)}'...
Try:

awk '{ printf "%f\n",$3*($1+$2)}' filename
3,724
Posted By Scrutinizer
Divide by 1000 ? awk 'NF{print $1/1000}'...
Divide by 1000 ?

awk 'NF{print $1/1000}' OFMT="%.5f" file
1,343
Posted By Don Cragun
I don't understand. If the first line of the...
I don't understand.

If the first line of the file txtif.out is not x followed by a <newline> character, your script will exit without printing anything. Otherwise, you have an infinite loop...
1,160
Posted By RavinderSingh13
Hello Board27, If your Input_file's 2nd line...
Hello Board27,

If your Input_file's 2nd line is the one which you want to always get then following may help you in same.

awk 'NR==2{gsub(/.*:\"/,X,$0);sub(/\"/,X,$0);print}' Input_file
OR...
3,431
Posted By Don Cragun
You can save the last timestamp processed by your...
You can save the last timestamp processed by your awk script and reload that value in your shell script before calling awk the next time and then have awk skip over all lines with a timestamp that is...
1,589
Posted By Don Cragun
If your system's grep utility does not support...
If your system's grep utility does not support the -o option, you could also do this entirely in the shell (with any shell that performs basic POSIX-required parameter expansions) using:
while read...
5,766
Posted By rbatte1
Assuming generated your list with grep -vf...
Assuming generated your list with grep -vf listA.lst listB.lst or something similar, you can then:-grep -vf listA.lst listB.lst | while read file_ref
do
cp -p wavsdir/$file_ref.wav target_dir...
1,733
Posted By Aia
Place the whole command to watch within single...
Place the whole command to watch within single coma.
watch -n1 'command /dev/x | cat >> output'
However, the command cat it not necessary there.

watch -n1 'command /dev/x >> output'
1,482
Posted By Don Cragun
Do you have so many files matching your pattern...
Do you have so many files matching your pattern that the simple:
cat test.* > output
won't work?
Forum: Programming 09-05-2015
1,497
Posted By Aia
Hi Board27, This is the information I have...
Hi Board27,

This is the information I have parsed so far.
return (float(when), int(count)) will give you a tuple comprised of a float and an int, but you say -- "it gives me the result with tre...
2,069
Posted By jim mcnamara
Let me understand here. Hmm. [...
Let me understand here.


Hmm.


[ -d /spec ] || mkdir /spec
find /*.wav |
while read fname
do
xxx $fname -o /spec/spec-${fname}-$(date -u +%Y%m%dt%H%M)
done

I added the...
819
Posted By RavinderSingh13
Hello Board27, Please always do show us the...
Hello Board27,

Please always do show us the input and expected output to understand requirement completly.
Following is an example for same, but completly on my assumptions only.

Let's say...
2,618
Posted By fpmurphy
Why can you not simply do a "make clean" in your...
Why can you not simply do a "make clean" in your build directory and then create a tarball of the build directory for copying to the other system?
1,009
Posted By RudiC
Depending on your OS and the shell you use, this...
Depending on your OS and the shell you use, this might work:sox $(ls -t /direxample/*.wav| head -1) -n spectrogram will always use the latest file in that directory.
Showing results 1 to 21 of 21

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