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 303020344 by Tahir_M on Tuesday 17th of July 2018 05:27:13 AM
Old 07-17-2018
If this helps...
Sum_amounts in the output should have the values from column PurchaseOrder_TotalCost(from abc.csv) with last value being sum of all the values.

The output which I have put previuosly was just an example how the output should be generated.

Here is the actual output that I should get :
Code:
DATE,ROW_COUNT,Amount_Totals

20180712,,"   3740.0000"

20180712,,"   5610.0000"

20180712,,"   100.0000"

20180712,,"   50.0000"

20180712,,"   5610.0000"

20180712,,"   200.0000"

20180712,,"   2250.0000"

20180712,,"   2750.0000"

20180712,,"   2400.0000"

20180712,,"   2400.0000"

20180712,,"   2400.0000"

20180712,,"   1200.0000"

20180712,,"   2400.0000"

20180712,,"   2400.0000"

20180712,,"   500.0000"

20180712,,"   2000.0000"

20180712,,"   12000.0000"

20180712,,"   130.0000"

20180712,,"   5500.0000"

20180712,,"   1200.0000"

20180712,,"   1200.0000"

20180712,,"   220.8000"

20180712,,"   338.5000"

20180712,,"   1200.0000"

20180712,,"   129.0000"

20180712,,"   40.0000"

20180712,,"   1200.0000"

20180712,,"   9750.0000"

20180712,,"   9750.0000"

20180712,,"   9750.0000"

20180712,,"   9750.0000"

20180712,," 1250.0000"

Total,36,99483.6

If this helps well and good, if not still good.I'll just have to keep searching through google to crack it.

Thanks for the help!
 

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
mlib_VideoColorYUV444seq_to_ABGRint(3MLIB)		    mediaLib Library Functions			mlib_VideoColorYUV444seq_to_ABGRint(3MLIB)

NAME
mlib_VideoColorYUV444seq_to_ABGRint - color convert YUV sequential to ABGR interleaved SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> void mlib_VideoColorYUV444seq_to_ABGRint(mlib_u32 *ABGR, const mlib_u8 *Y, const mlib_u8 *U, const mlib_u8 *V, const mlib_u8 *A_array, mlib_u8 A_const, mlib_s32 w, mlib_s32 h, mlib_s32 dlb, mlib_s32 slb); DESCRIPTION
The Y, U, V pixel streams are converted into an ABGR pixel stream. All pixel components are 8-bit unsigned integers. All buffers have dimensions w and h. The alpha values for this function work in the following fashion: o If A_array pointer is not NULL, the values are taken from there. It has to have the same dimensions as the Y buffer. o If A_array pointer is NULL, the alpha values for every pixel are set to A_const. The following equation is used: |R| |1.1644 0.0000 1.5966| [|Y| | 16.0000|] |G| = |1.1644 -0.3920 -0.8132| * [|U| - |128.0000|] |B| |1.1644 2.0184 0.0000| [|V| |128.0000|] PARAMETERS
The function takes the following arguments: ABGR Pointer to output buffer. Y Pointer to Y input buffer. U Pointer to U input buffer. V Pointer to V input buffer. A_array Array of alpha values. A_const Constant alpha value. w Image width in pixels. h Image height in lines. dlb Linebytes for output buffer. slb Linebytes for input buffers. RETURN VALUES
None. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VideoColorYUV420seq_to_ARGBint(3MLIB), mlib_VideoColorYUV411seq_to_ARGBint(3MLIB), mlib_VideoColorYUV422seq_to_ARGBint(3MLIB), mlib_VideoColorYUV444seq_to_ARGBint(3MLIB), mlib_VideoColorYUV420seq_to_ABGRint(3MLIB), mlib_VideoColorYUV411seq_to_ABGRint(3MLIB), mlib_VideoColorYUV422seq_to_ABGRint(3MLIB), mlib_VideoColorYUYV422int_to_ARGBint(3MLIB), mlib_VideoColorYUV444int_to_ARGBint(3MLIB), mlib_VideoColorYUYV422int_to_ABGRint(3MLIB), mlib_VideoColorYUV444int_to_ABGRint(3MLIB), mlib_VideoColorUYVY422int_to_ARGBint(3MLIB), mlib_VideoColorUYVY422int_to_ABGRint(3MLIB), mlib_VideoColorUYV444int_to_ARGBint(3MLIB), mlib_VideoColorUYV444int_to_ABGRint(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_VideoColorYUV444seq_to_ABGRint(3MLIB)
All times are GMT -4. The time now is 04:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy