Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Copy columns from one file into another and get sum of column values and row count Post 303020321 by Tahir_M on Monday 16th of July 2018 09:48:23 PM
Old 07-16-2018
Yes UTF-8 does exist in the file.
The Date Column should have the current date values: example

Code:
DATE                           Sum_Amount     RECORD_COUNT

07/15/2018                      29039.44         

07/15/2018                     314038.03         

07/15/2018                      41424.75         

07/15/2018                      90314.27         

07/15/2018                      66416.22         

07/15/2018                       2013.55         

07/15/2018                       1172.35         

Total:                             544418.61        51

All the amounts are in same currency i.e USD.

Last edited by Tahir_M; 07-16-2018 at 10:50 PM.. Reason: adding proper code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check Null values in a file column by column if columns are Not NULLs

Hi All, I have a table with 10 columns. Some columns(2nd,4th,5th,7th,8th and 10th) are Not Null columns. I'll get a tab-delimited file and want to check col by col and generate seperate error code for each col eg:102 if 2nd col value is NULL and 104 if 4th col value is NULL so on... I am a... (7 Replies)
Discussion started by: Mandab
7 Replies

2. Shell Programming and Scripting

print unique values of a column and sum up the corresponding values in next column

Hi All, I have a file which is having 3 columns as (string string integer) a b 1 x y 2 p k 5 y y 4 ..... ..... Question: I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies

3. Shell Programming and Scripting

Sum of values coming in a row

Hi, my requirement is to sum values in a row. eg: input is: sum,value1,value2,value3,.....,value N Required Output: sum,<summation of N values> Please help me... (5 Replies)
Discussion started by: MrGopal666
5 Replies

4. Shell Programming and Scripting

Copy values from columns matching in those in second file.

Hi All, I have two sets of files. Set 1: 100 text files with extension .txt with names like 1.txt, 2.txt, 3.txt until 100.txt Set 2: One big file with extension .dat The text files have some records in columns like this: 0.7316431 82628 0.7248189 82577 0.7248182 81369 0.7222999... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

5. UNIX for Dummies Questions & Answers

Count on grep for more than two values in a row of fixed length file

I want to get count on number of records in a few folders by running grep command for more than two columns in a row of fixed length file. suppose if i have a fixed length file has 5 columns and I want to see the record counts for country =can and province = bc and time stamp <= 12 feb 2013... (14 Replies)
Discussion started by: princetd001
14 Replies

6. Shell Programming and Scripting

Sum specified values (columns) per row

Hello out there, file.txt: comp51820_c1_seq1 42 N 0:0:0:0:0:0 1:0:0:0:0:0 0:0:0:0:0:0 3:0:0:0:0:0 0:0:0:0:0:0 comp51820_c1_seq1 43 N 0:0:0:0:0:0 0:1:0:0:0:0 0:0:0:0:0:0 0:3:0:0:0:0 0:0:0:0:0:0 comp51820_c1_seq1 44 N 0:0:4:0:3:1 0:0:1:9:0:0 10:0:0:0:0:0 0:3:3:2:2:6 2:2:2:5:60:3... (16 Replies)
Discussion started by: pathunkathunk
16 Replies

7. UNIX for Dummies Questions & Answers

Unique values in a row sum the next column in UNIX

Hi would like to ask you guys any advise regarding my problem I have this kind of data file.txt 111111111,20 111111111,50 222222222,70 333333333,40 444444444,10 444444444,20 I need to get this file1.txt 111111111,70 222222222,70 333333333,40 444444444,30 using this code I can... (6 Replies)
Discussion started by: reks
6 Replies

8. Shell Programming and Scripting

Add sum of columns and max as new row

Hi, I am a new bie i need some help with respect to shell onliner; I have data in following format Name FromDate UntilDate Active Changed Touched Test 28-03-2013 28-03-2013 1 0.6667 100 Test2 28-03-2013 03-04-2013 ... (1 Reply)
Discussion started by: gangaraju6
1 Replies

9. Shell Programming and Scripting

Sum values of specific column in multiple files, considering ranges defined in another file

I have a file (let say file B) like this: File B: A1 3 5 A1 7 9 A2 2 5 A3 1 3 The first column defines a filename and the other two define a range in that specific file. In the same directory, I have also three more files (File A1, A2 and A3). Here is 10 sample lines... (3 Replies)
Discussion started by: Bastami
3 Replies

10. Shell Programming and Scripting

Do replace operation and awk to sum multiple columns if another column has duplicate values

Hi Experts, Please bear with me, i need help I am learning AWk and stuck up in one issue. First point : I want to sum up column value for column 7, 9, 11,13 and column15 if rows in column 5 are duplicates.No action to be taken for rows where value in column 5 is unique. Second point : For... (12 Replies)
Discussion started by: as7951
12 Replies
lpoptions(1)							    Apple Inc.							      lpoptions(1)

NAME
lpoptions - display or set printer options and defaults SYNOPSIS
lpoptions [ -E ] [ -h server[:port] ] -d destination[/instance] [ -l ] lpoptions [ -E ] [ -h server[:port] ] [ -p destination[/instance] ] -o option[=value] ... lpoptions [ -E ] [ -h server[:port] ] [ -p destination[/instance] ] -r option lpoptions [ -E ] [ -h server[:port] ] -x destination[/instance] DESCRIPTION
lpoptions displays or sets printer options and defaults. If no printer is specified using the -p option, the default printer is used as described in lp(1). If no -l, -o, or -r options are specified, the current options are reported on the standard output. Options set with the lpoptions command are used by the lp(1) and lpr(1) commands when submitting jobs. When run by the root user, lpoptions gets and sets default options and instances for all users in the /etc/cups/lpoptions file. Otherwise, the per-user defaults are managed in the ~/.cups/lpoptions file. OPTIONS
lpoptions supports the following options: -E Enables encryption when communicating with the CUPS server. -d destination[/instance] Sets the user default printer to destination. If instance is supplied then that particular instance is used. This option overrides the system default printer for the current user. -h server[:port] Uses an alternate server. -l Lists the printer specific options and their current settings. -o option[=value] Specifies a new option for the named destination. -p destination[/instance] Sets the destination and instance, if specified, for any options that follow. If the named instance does not exist then it is cre- ated. Destinations can only be created using the lpadmin(8) program. -r option Removes the specified option from the named destination. -x destination[/instance] Removes the options for the named destination and instance, if specified. If the named instance does not exist then this does noth- ing. Destinations can only be removed using the lpadmin(8) command. FILES
~/.cups/lpoptions - user defaults and instances created by non-root users. /etc/cups/lpoptions - system-wide defaults and instances created by the root user. CONFORMING TO
The lpoptions command is unique to CUPS. SEE ALSO
cancel(1), lp(1), lpadmin(8), lpr(1), lprm(1), CUPS Online Help (http://localhost:631/help) COPYRIGHT
Copyright (C) 2007-2018 by Apple Inc. 10 April 2018 CUPS lpoptions(1)
All times are GMT -4. The time now is 02:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy