Hi,
I have 9 files which are generated dynamically & if there is a some condition which doesn't meet the criteria then file is not created or is of zero size.
so further i am unable to consolidate the files based on following code 1
where following code has filenames in the form of array
Please help to suggest for modifying the code 1 so that all filecounters are mapped accordingly.
---------- Post updated at 04:35 PM ---------- Previous update was at 02:51 PM ----------
i am trying to create files using touch command in case files are not created which are stored in array(${pp_sms_rej_countfile[@]}). But still mapping doesnt occur perfectly. The conclusion which i draw from here is awk would take inputs from only files whose size is greater than 0. So can anybody help me of this loop, so that correct mapping is done?
---------- Post updated at 05:06 PM ---------- Previous update was at 04:35 PM ----------
To update all,
pp_sms_rej_countfile[0]="krl_test_rej"
pp_sms_rej_countfile[1]="Guj_test_rej"
pp_sms_rej_countfile[2]="del_test_rej"
pp_sms_rej_countfile[3]="upw_test_rej"
pp_sms_rej_countfile[4]="CHN_test_rej"
pp_sms_rej_countfile[5]="KOL_test_rej"
pp_sms_rej_countfile[6]="KTK_test_rej"
pp_sms_rej_countfile[7]="RAJ_test_rej"
pp_sms_rej_countfile[8]="ROWB_test_rej"
content of totalfile is as follows:
content of one of the files krl_test_rej
so code would look for $1 in totalfilename & print $2 from krl_test_rej
Output required will be something like say if krl_test_rej file has $1(from totalfilename) then value of the same will be printed and in case $1 is present in other files of array then it will be updated accordingly as per the position mentioned in the code
20140720113251.1265,1,0,0,0,0,0,0,0,0,0,0,0,1
---------- Post updated at 05:06 PM ---------- Previous update was at 05:06 PM ----------
To update all,
pp_sms_rej_countfile[0]="krl_test_rej"
pp_sms_rej_countfile[1]="Guj_test_rej"
pp_sms_rej_countfile[2]="del_test_rej"
pp_sms_rej_countfile[3]="upw_test_rej"
pp_sms_rej_countfile[4]="CHN_test_rej"
pp_sms_rej_countfile[5]="KOL_test_rej"
pp_sms_rej_countfile[6]="KTK_test_rej"
pp_sms_rej_countfile[7]="RAJ_test_rej"
pp_sms_rej_countfile[8]="ROWB_test_rej"
content of totalfile is as follows:
content of one of the files krl_test_rej
so code would look for $1 in totalfilename & print $2 from krl_test_rej
Output required will be something like say if krl_test_rej file has $1(from totalfilename) then value of the same will be printed and in case $1 is present in other files of array then it will be updated accordingly as per the position mentioned in the code
20140720113251.1265,1,0,0,0,0,0,0,0,0,0,0,0,1
Hello,
I have a file with below content - Example
3
6
69
139
210
345
395
418
490
492
I would like the result as - Multiple of 70 or nearest number in the file less than the multiple of 70
69
139 (5 Replies)
HI Guys,
I have some 8 files with different name and extensions. I need to check if they are present in a specific folder or not and also want that script to show me which all are not present. I can write if condition for each file but from a developer perspective , i feel that is not a good... (3 Replies)
Dear all,
I am using following function of some script to assign variable "JobNo" some value form file $SAMPLE"_status.log" ( generated using the red color command )
crab ntuplize_crab -status -c $SAMPLE >& $SAMPLE"_status.log" &
echo $SAMPLE"_status.log" "====="
jobNo=$(awk... (10 Replies)
Good day all
I need some helps,
say that I have data like below, each field separated by a tab
DATE NAME ADDRESS
15/7/2012 LX a.b.c
15/7/2012 LX1 a.b.c
16/7/2012 AB a.b.c
16/7/2012 AB2 a.b.c
15/7/2012 LX2 a.b.c... (2 Replies)
Hi,
I need to check whether a particular file exists ot not using awk.
Can anyone help me please?
For Example:script that i am using:
awk '{filename =$NF;
rc=(system("test -r filename")) print $rc;}' "$1"
is not working.
Here I am passing a text file as input whose last word contains a... (6 Replies)
Hi,
I am new to unix and would greatly appreciate some help.
I have a file containing multiple colums containing different sets of data e.g.
File 1:
John Ireland 27_December_69
Mary England 13_March_55
Mike France 02_June_80
I am currently using the awk... (10 Replies)
I have a file that looks like this, with the first number in each block within each SOURCE declaration being a distance.
%( PHASES
P
%)
%( SOURCES
(10,0.0)
(13,0.0)
(16,0.0)
(19,0.0)
(22,0.0)
(25,0.0)
(28,0.0)
(31,0.0)
(34,0.0)
(37,0.0) (0 Replies)
I want to check the files in particular directory are more that 0 Bytes i.e, Non zero byte file. The script should print a msg if all the files in that directory are empty( 0 Byte). (2 Replies)