Sponsored Content
Top Forums Shell Programming and Scripting How do I include the file being compared into calculation? Post 302584877 by ahamed101 on Monday 26th of December 2011 08:34:40 AM
Old 12-26-2011
Code:
nawk -F, 'NR==FNR{a[$1OFS$2OFS$3]++;next} a[$1OFS$2OFS$3]{b[$1OFS$2OFS$3]++;}
END{ for(i in a){if(a[i] && !b[i]){print "NEW: "i}} for(i in b){if(b[i])print i"\t\t"b[i]}}' OFS=, 123.csv *.csv

--ahamed
This User Gave Thanks to ahamed101 For This Post:
 

9 More Discussions You Might Find Interesting

1. Programming

Not able to compile Pro*c file due - give errors and points to /usr/include/.. file

I am trying to compile the pro*C file but gives errors. It says it encountered "std" while it was expecting ; , = ( $ $ORACLE_HOME/bin/proc tradewind/dataaccess/Blob.pcc Pro*C/C++: Release 10.2.0.3.0 - Production on Fri May 9 11:10:54 2008 Copyright (c) 1982, 2005, Oracle. All rights... (0 Replies)
Discussion started by: shafi2all
0 Replies

2. UNIX for Dummies Questions & Answers

calculation on a large file

Trying to do some simple maths on a large file. Excel works fine but I have 1 million entries: If the difference between a number in column 2 and the one above it is more than 100 the insert a new line 8 4001 4100 8 4101 4200 8 4201 4300 8 15901 16000 8 15910 ... (1 Reply)
Discussion started by: dr_sabz
1 Replies

3. Shell Programming and Scripting

File Size calculation with AWK

Hello Friends, Im calculating file sizes with below AWK script. I do this before some spesific files are transferred. I run the script it works but after several running it stuck with a limit of 2147483647 (2 Gbytes -1 byte) and cant exceed this. Something is wrong and I can't proceed, would... (1 Reply)
Discussion started by: EAGL€
1 Replies

4. Shell Programming and Scripting

include file name to extracted files

I've written the script below to merge only .txt files that exist in one directory into one huge .txt file and ignore other files with other extensions. now the result is one huge .txt file with all the contents of other .txt files how can i add a File Name as a comment before each file? ... (12 Replies)
Discussion started by: miss_dodi
12 Replies

5. Shell Programming and Scripting

Calculation from a file

Hi , I have a file with below format 6/1/200618:00:011348797339524635352499218493964052971 6/1/200617:00:011348672070311735349025833693964052971 6/1/200616:00:011348546711070035345679259193964052971 I want a output as below 6/1/200618:00:011348797339524635352499218493964052971... (1 Reply)
Discussion started by: manojit123
1 Replies

6. Shell Programming and Scripting

math calculation for a txt file

Hi All, I have a text file which is only one column. I want to multiply all these values in file1.txt by 0.01 and get the output.txt file1.txt 65 85 90 ... output.txt 0.65 0.85 0.90 ... Thanks. Please use code tags when posting data and code samples! (2 Replies)
Discussion started by: senayasma
2 Replies

7. Shell Programming and Scripting

Need to include two more columns in the file using awk

Hi, I have a input file with many records as below: 1J4RR4GG0BC508200 68646 1 N M i want my output file to be like with columns included dgismdh and timestamp : Example: 1J4RR4GG0BC508200 68646 1 N M dgismdh 2012-02-21 07:22:25.98591 How to do it.can we do using awk? Pls help. (6 Replies)
Discussion started by: sonam273
6 Replies

8. Shell Programming and Scripting

Get file name which include the current date

Hi, I'm trying to get the name of a file that has the current date in the name. The filename is on the form A<current date>01.DC, for example A2012110501.DC I have this script so far date +%y%m%d D=$(date +%y%m%d) N=A20$D echo $N N2={$N}01.DC echo $N2 And gets the following... (12 Replies)
Discussion started by: Immelstorn
12 Replies

9. Shell Programming and Scripting

Help with awk percentage calculation from a file

i have a file say test with the below mentioned details Folder Name Total space Space used /test/test1 500.1GB 112.0 GB /test/test2 3.2 TB 5TB /test/test3 3TB 100GB i need to calculate percentage of each row based on total space and space used and copy... (9 Replies)
Discussion started by: venkitesh
9 Replies
GNUNET-TESTING(1)					      General Commands Manual						 GNUNET-TESTING(1)

NAME
gnunet-testing - Command line tool to access the testing library. SYNOPSIS
gnunet-testing [options] DESCRIPTION
gnunet-testing is a command line tool to access the testing library. OPTIONS
-C, --cfg Create unique configuration files. -c FILENAME, --config=FILENAME Use the configuration file FILENAME. -H, --hostkeys Host key file. -h, --help Print short help on options. -k, --key Create hostkey files from pre-computed hostkey list. -L LOGLEVEL, --loglevel=LOGLEVEL Use LOGLEVEL for logging. Valid values are DEBUG, INFO, WARNING and ERROR. -l LOGFILE, --logfile=LOGFILE Configure logging to write logs to LOGFILE. -n, --number Number of unique configuration files or hostkeys to create. -t, --template Configuration template. -v, --version Print GNUnet version number. BUGS
Report bugs by using Mantis <https://gnunet.org/bugs/> or by sending electronic mail to <gnunet-developers@gnu.org> GNUnet Jan 4, 2012 GNUNET-TESTING(1)
All times are GMT -4. The time now is 05:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy