Sponsored Content
Full Discussion: Duplication | awk | result
Top Forums UNIX for Beginners Questions & Answers Duplication | awk | result Post 303036041 by Aurimas on Thursday 13th of June 2019 07:14:44 AM
Old 06-13-2019
Quote:
Originally Posted by RudiC
Of course you don't get any output as the $AAA shell variable is not expanded within single quotes. Why not use the standard awk interface as shown before? And, don't test $0 for a match but $2 only.
What you mean by single quotes? When I put "" on $AAA in awk '{ if ($0 ~ /"$AAA"/) sum += $3} END {print sum}' $i I am still getting no output.
As what you mean by awk standard interface as before? I tried using it but I need the output to print $3 column numerical values and not count how many ALA words there are. Any idea where I could read about this?
As for testing $2 instead of $0 I am getting zeros when I apply the awk command from before. I am reading and trying to implement it to change for checking if line has ALA and then take that lines 3rd column's numerical value and add it to other lines with ALA words and 3rd column's numerical values so I could have a sum of all ALA 3rd column numerical values. What should I read into or try to implement?
 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

File Duplication

hi all how to find the file duplication in a windows 2000 server as usual replies are sincerely appreciated. thanks raguram R (3 Replies)
Discussion started by: raguramtgr
3 Replies

2. HP-UX

awk to output cmd result

I was wondering if it was possible to tell awk to print the output of a command in the print. .... | awk '{print $0}' I would like it to print the date right before $0, so something like (this doesn't work though) .... | awk '{print date $0}' (4 Replies)
Discussion started by: IMTheNachoMan
4 Replies

3. UNIX for Advanced & Expert Users

mount LVM duplication drives

Hi, I'm stuck in an awkward situation please help :) I have two identical Seagate 80GB harddrives. My objective is a bit strange. 1.I want to have a cloned disk as bootable backup 2.When booting using the master drive, I also want to mount the cloned backup disk so I can do incremental... (6 Replies)
Discussion started by: onthetopo
6 Replies

4. Shell Programming and Scripting

File Duplication Script?

I have a file, let's say 1.jpg, and I have a text file that contains a list of filenames I would like to duplicate 1.jpg as (i.e., 2.jpg, 3.jpg, 4.jpg, etc.). The filenames that I want to create are all on separate lines, one per line. I'm sure there's a simple solution, but I'm not claiming to... (7 Replies)
Discussion started by: futurestar
7 Replies

5. Shell Programming and Scripting

How to avoid duplication within 2 files?

Hi all, Actually 2 files are there - file1, file2. file1 contains ---> london mosco america russia mosco file2 contains --> europe india japan mosco england london Question is I want to print all the city names without duplication cities in those... (10 Replies)
Discussion started by: balan_mca
10 Replies

6. UNIX for Advanced & Expert Users

File Descriptor redirection and duplication

i have many questions concerning the FD. it was stated that "to redirect Error to output std, you have to write the following code" # ls -alt FileNotThere File > logfile 2>&1 # cat logfile ls: cannot access FileNotThere: No such file or directory -rw-r--r-- 1 root root 0 2010-02-26... (9 Replies)
Discussion started by: ahmad.zuhd
9 Replies

7. Programming

Table Duplication in PHP

Hey, I am making a Facebook like Page system as my first project, So far it's been bate in mind I did it from my 3DS at the same time as my PC gets replaced, So far it's turned out great. Now I am on to creation the blocking system I need to get the code to say If the user already likes the... (0 Replies)
Discussion started by: AimyThomas
0 Replies

8. Linux

De-Duplication Problem

Hi all, I download and install lessfs for deduplication, I copy files in /SharedFiles directory and lessfs work right and not store again copy files, but, when i delete all files in /SharedFiles , not return free space to total space, files not show in /SharedFiles , but not copy new files in... (3 Replies)
Discussion started by: saeedha
3 Replies

9. UNIX for Beginners Questions & Answers

Line duplication with awk?!

So while this seemed totally trivial it turned out to be much more difficult than I had thought. I have a file with 3 rows, and I "just" want to add each field n number of times. E.g. > cat file.txt 0.5 -0.1 0.6 for n=3 into: cat newfile.txt 0.5 0.5 0.5 -0.1 -0.1 -0.1 0.6 0.6 0.6 I... (4 Replies)
Discussion started by: Glorp
4 Replies

10. UNIX for Beginners Questions & Answers

Unexpected result from awk

Hello, Giving those commands: cat > myfile 1 2 3 ^D cat myfile | awk '{ s=s+$1 ; print s}' The output is: 1 3 6 It seems like this command iterates each time on a different row so $1 is the first field of each row.. But what caused it to refer to each row ?. What I mean... (3 Replies)
Discussion started by: uniran
3 Replies
MINTEGRATE(1)							   User Commands						     MINTEGRATE(1)

NAME
mintegrate - evaluate average/sum/integral/derivative of 1-d numerical data SYNOPSIS
mintegrate [OPTION]... [FILE] DESCRIPTION
mintegrate is a program to compute averages, sums, integrals or derivatives of numerical 1-d data in situations where ultimate numerical precision is not needed. OPTIONS
-a compute mean value (arithmetic average) and standard deviation -c compute integral on closed x-data interval; In case that dx is not specified by the '-d' flag, the data are supposed to be from an irregular x-grid, and dx is computed separately for every x-interval. The integral is computed by the trapezoidal rule. -d <float> compute integral on open x-data interval with the specified dx; Can be used also in combination with '-D' and '-c'. -D compute difference btw. numbers or derivative of the y-data; In the default scenario where x- and y-data column are same, the dif- ference btw. the current and the previous data value will be output. In this case when '-d' is defined as 0, the x-data value will be print out in front of the calculated difference. If x-and the y-column are different and if the x-data resolution is not defined or it is !=0, then the derivative of the y-data is calculated. When the x-data resolution is constant, specify it explicitly by '-d' to achieve a higher numerical precision by a 'leapfrog' algorithm. -x <int> x-data column (default is 1). If 0, the x-range is an index; -y <int> y-data column, where y=f(x) (default is 1) -r x_0:x_1 x-data range to consider -s print out accumulated y_i sums: x_i versus accumulated f(x_i); In the case of a closed integral you have to specify also the x-data resolution dx (see '-d' above). -S compute the accumulated y_i-sums and add it to the output -p <str> print format of the result ("%.10g" is default) -t <str> output text in front of the result (invalid with '-s' or '-S'); A blank can be printed by using a double underscore character '__'. -T run a self-test that the program is working correctly -V print version number --version output version and license message --help|-H display help -h display short help (options summary) If none of the options '-a', '-D', '-d', or '-c' is used, then the sum of the provided data will be computed. Empty lines or lines starting with '#' are skipped. This program is perfectly suitable as a basic tool for initial data analysis and will meet the expected accuracy of a numerical solution for the most demanding computer users and professionals. Yet be aware that, although the computations are carried with double floating pre- cision, the computational techniques used for evaluating an integral or a standard deviation are analytically low-order approximations, and thus not intended to be used for numerical computations in engineering or mathematical sciences for cases where an ultimate numerical pre- cision is a must. For deeper understanding of the topic see http://en.wikipedia.org/wiki/Numerical_analysis. COPYRIGHT
Copyright (C) 1997, 2001, 2006-2007, 2009, 2011-2012 Dimitar Ivanov License: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. mintegrate 2.2.1 February 2012 MINTEGRATE(1)
All times are GMT -4. The time now is 03:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy