Search Results

Search: Posts Made By: Tahir_M
1,766
Posted By Tahir_M
If this helps... Sum_amounts in the output...
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...
1,766
Posted By Tahir_M
I want to print sum of values from column...
I want to print sum of values from column PurchaseOrder_TotalCost into the output file but the output file should not include null and Zero(if any).
1,766
Posted By Tahir_M
Yes UTF-8 does exist in the file. The Date...
Yes UTF-8 does exist in the file.
The Date Column should have the current date values: example


DATE Sum_Amount RECORD_COUNT

07/15/2018 ...
1,766
Posted By Tahir_M
Copy columns from one file into another and get sum of column values and row count
I have a file abc.csv, from which I need column 24(PurchaseOrder_TotalCost) to get the sum_of_amounts with date and row count into another file say output.csv

abc.csv-
...
Forum: What is on Your Mind? 07-16-2018
1,516
Posted By Tahir_M
Amazing, Kudos Man! Always helped me around...
Amazing, Kudos Man!

Always helped me around :)

A million thanks!
3,423
Posted By Tahir_M
Code using sed
Sorry for the late reply, I have been busy with multiple things rn.

Thanks for the help Rudic!

Here is what I used...
I didn't delete the complete Row from the file, instead I just removed the...
3,423
Posted By Tahir_M
It works too.. but still the output is not in...
It works too.. but still the output is not in decimal.

I'm done with the code part and was able to add few more things..

I'll share my code here once i'm all done.. 5-10%of coding pending I can...
3,423
Posted By Tahir_M
New code
So after trying and trying, I found playing with awk little hard :(

So I tried a new approach.

here is the code...


#!/bin/bash/sh
a=0.000000
for value in `cat file1 | grep Total | tr -s...
3,423
Posted By Tahir_M
Sorry, for the wrong context here. By any, I...
Sorry, for the wrong context here.

By any, I meant, different sets which are created every day with a similar format and equivalent structure.

Also, I want the output to be displayed in a...
3,423
Posted By Tahir_M
Awesome, it works! Do I need to change anything...
Awesome, it works!
Do I need to change anything in the code if I want this work for any 2 sets of files?

Thanks for the help! :)
3,423
Posted By Tahir_M
I'm getting a variance again, :( awk ' ...
I'm getting a variance again, :(


awk '
FNR == 1 {next
}
FNR == NR {if (/^Total/) SUM += $2*100
next
}
{SUM -=...
3,423
Posted By Tahir_M
I copied the data from a file and pasted here as...
I copied the data from a file and pasted here as I didn't know how to upload a file.

This is the actual structure of the files.

Sorry for the mess up. :(

---------- Post updated at 05:58 PM...
3,423
Posted By Tahir_M
Please find attachments: 7318
Please find attachments:

7318
3,423
Posted By Tahir_M
It's working! Thank you! But for that data...
It's working!
Thank you!

But for that data provided here.

When saving this data manually and run the code for these files it works but not for the data/files which are generated from the...
3,423
Posted By Tahir_M
Replying:
No, I didn't change anything. However, to be precise I used two new files and still got the variance.

When you run this in unix, are you getting a variance of 0?
:confused:
3,423
Posted By Tahir_M
Please refer to this, let me know if i'm doing...
Please refer to this, let me know if i'm doing anything wrong?

cat Test1.sh
awk '
FNR == 1 {next
}
FNR == NR {if (/^Total/) SUM += $2*100
next
...
3,423
Posted By Tahir_M
Replying:
The two files don't have a variance.

But the code shows a huge Variance?!
3,423
Posted By Tahir_M
Where Ariba is File1 and Pay is File2 as per actual post
Yes, I did!

I'm still a Layman but here is what I tried.


#!/bin/bash/sh
a=0.000000
for value in `cat Ariba.csv | grep Total | tr -s " " " " | cut -d " " -f2`
do
a=$(echo $a + $value |...
3,423
Posted By Tahir_M
Compare sum of two columns if variance is zero do nothing else send an email
11☺Hi,

I have to data sets:
One is in .txt format and other is in .csv format, please refer below two outputs from two files.
File1.txt
SOURCE PAYDATE TOTAL_DOLLARS ...
Showing results 1 to 19 of 19

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