Thanks for looking into my requirement let me summerize what i am trying achieve.
i have source data in Germany_Source_1.txt, Germany_Source_2.txt ...nth.txt files which contains business keys.
Obligor_ID is business key. using given 18 Obligor_ID i am dividing Germay_Source files for Greece and Germany when Given Obligor_ID not found in each row then i need that row/line as Greece_Source_1.txt .*_2.txt....*_nth.txt file found Obligor_ID information i am keeping Greece_Source_1 ...*_2.txt....*_nth.txt.
Note: Obligor_ID column position is not a fixed position on every file
i would like to achieve based on source file i have to check Obligor_ID coulm position on the column then i have to write out put to another file whenever list of 19 Obligors not found on the row/line.
Source Data sample
I have corrected command_construction variable properly, now my script is working fine. but i am still looking for better solution on below part of script to maintain it easily.
Can you please suggest with good solution in below part of script how maintain it easy.
Moderator's Comments:
Please use CODE tags for sample input and output as well as for code segments.
Last edited by Corona688; 09-08-2016 at 12:24 PM..
Reason: Replaced private data with gibberish
Hi Gurus,
In my file I have an amount field from position 74 to 87, which contains values starting with '+' as well as '-'. I want to add all positive values in a varible called "CREDIT" and all negative values in a variable "DEBIT". I know, we can use grep to identify values with positive and... (4 Replies)
hi i am using printf in a script and it is not printing negative values..i have to use printf to get rid of the newline..here is my code:
fin=`echo $a - $b | bc`
printf "${fin}," >> test
these statements are in a loop. here is what i get when i try to subtract 4 from 8:
./scr1: line... (2 Replies)
Hello,
I have a list like this :
1
2
-4
0
-3
-7
5
6 etc.
Is there a way to remove all the positive values and print only the negative values, without using grep, sed or awk?
Thanks,
Prasanna (4 Replies)
Hi all,
I have a file that looks like shown below. I want to find places where the value in column 2 change from negative to positive and vice versa and return the value on column 1 at that point. I wonder if this is possible in shell script or awk .. please help!
Here is the original data
... (6 Replies)
Ok, so i monitor disk space on remote machines using snmp. Works great for me. But whenever a particular partition happens to have Terabytes of data, snmp starts reporting negative values.
Can someone please tell me how to get around this problem?
The AllocationUnit is 512 bytes. Weird... (0 Replies)
Hi, i need help on replacing negative values in a column with 0. any quick fix on this? thanks much. for instance,
input:
1
2.3
-0.4
-25
12
13
45
-12
desired output
1
2.3
0
0
12
13
45 (4 Replies)
Can anyone please assist me?
Please find the attached input and output file for ur reference.
a)Incase if i get negative value (ex:-000100) in the 11th column then i have to convert the value to 0000000(7 zeros-length is 7) and then
print the entire record.
b)Incase if there is no... (2 Replies)
Hi Gurus,
I have requirement need to sum the value, the logic is if the value is negative then time -1, I tried below two ways. one is failed, another one doesn't work.
awk -F"," '{if($8< 0 $8*-1 else $8) sum+=$8}{print sum, $8} END{printf("%.2f\n",sum)}'
awk -F","... (4 Replies)