Search Results

Search: Posts Made By: am24
1,133
Posted By am24
Thanks all for your replies. I will try it. ...
Thanks all for your replies.

I will try it.

Regards,
am24
1,133
Posted By am24
Scripting Issue
Hi All,

I am facing a problem when i am trying to run shell script more than 5 times.

I have shell script(.sh file) which ran perfectly fine in the early attempts(1,2,3,4 runs). But if i try to...
2,848
Posted By am24
Hi Rudi, Now i ma able to get the outputs...
Hi Rudi,

Now i ma able to get the outputs properly with the code:

for (i=2; i<=CNF+2; i++){printf "%7s", T[i] > ofn; if(i==18) printf "%7.3f",T[i]=TMP > ofn}
{ printf RS > ofn}

Thanks a...
2,848
Posted By am24
Hi Rudi, I have changed the code because...
Hi Rudi,

I have changed the code because you have suggested me as below:

Redirect EVERY SINGLE print/printf to ofn.

Then after changing the code like this,

for (i=2; i<=CNF+2;...
2,848
Posted By am24
Hi Rudi, In both the cases printf RS > ofn ...
Hi Rudi,

In both the cases printf RS > ofn and print "" > ofn, I am getting the outputs as same as inputs . The arithmetic operation which i performed on 19th field is not reflecting in my...
2,848
Posted By am24
Rudi, as per your suggestions , i have modified...
Rudi, as per your suggestions , i have modified the first code below


for (i=2; i<=CNF+2; i++){printf "%7s", T[i]; if(i==18) {printf "%7.3f",T[i]=TMP}}

as

for (i=2; i<=CNF+2; i++){printf...
2,848
Posted By am24
Hi Rudi, I have tried with print > ofn. Then...
Hi Rudi,

I have tried with print > ofn. Then the outputs are generated as below:

032016501 3.974 96.026 20.605 28.838 21.722 28.835 0.306 0.000 66.204 0.229 0.000 16.707 5.348 0.000 ...
2,848
Posted By am24
Hi Rudi, I have tried like below. Now the...
Hi Rudi,

I have tried like below. Now the output is not displaying to teh screen but Output1 and output2 are generated with 56 lines input data as 1 line without modification on 19th field.
...
2,848
Posted By am24
Rudi , I am sorry . I really do not have any...
Rudi , I am sorry . I really do not have any hopes that i can get through this by my own. I am not understanding where i am doing mistake in the code.

Please let me know what is the mistake.
...
2,848
Posted By am24
Hi Rudi, Please find the below codes: 1st...
Hi Rudi,

Please find the below codes:
1st trail:
nawk '
FNR == 1 {
if(fc++)
close(ofn)
ofn = "test" fc
}
{CNF =...
2,848
Posted By am24
yes. i am redirecting it like printf > ofn. ...
yes. i am redirecting it like printf > ofn.

Results is displaying on screen and in the output file all the 56 lines merged as 1 line without the modification on 19th field.

Did i use the print...
2,848
Posted By am24
Hi Rudi, with printf > ofn , output is...
Hi Rudi,

with printf > ofn , output is generated like containing all the 56 lines data in one line.

Also output is displaying to the screen.

I really do not know how to proceed further on...
2,848
Posted By am24
Hi Rudi, I have tried the below codes before...
Hi Rudi,

I have tried the below codes before posting here. Please have a look into this.

1st trail:

nawk '
FNR == 1 {
if(fc++)
close(ofn)
ofn = "output" fc
printf > ofn
}
{CNF =...
2,848
Posted By am24
Rudi, i have tried all those but not able to get...
Rudi, i have tried all those but not able to get it. So asking for the help again ...

Regards,
am24
2,848
Posted By am24
Redirecting the results to different output files
Hi All,

I am trying a shell script and need your help on taking the results to different output files.
I have tried the below code:

nawk '
{CNF = (length()-10)/7
printf "%9s", substr ($0,...
2,918
Posted By am24
Hi Don and Rudi, Thanks for your time and...
Hi Don and Rudi,

Thanks for your time and Thank you so much for a clear explanation on the code.

Regards,
am24
2,918
Posted By am24
Hi Rudi and Don, Thanks for your time on...
Hi Rudi and Don,

Thanks for your time on this.Both of your codes worked perfectly fine.

Can you both please explain me the code ?

Regards,
am24
2,918
Posted By am24
Hi Rudi and pravin27, Thanks for the reply.I...
Hi Rudi and pravin27,

Thanks for the reply.I have tried both of your codes and the both worked fine.

Now i am applying the same code on seven input files where as my nawk6 contains 7 lines in...
2,918
Posted By am24
Thanks Rudi, I will try on this and will let...
Thanks Rudi,

I will try on this and will let you know.

Regards,
am24

---------- Post updated 05-13-16 at 02:12 AM ---------- Previous update was 05-12-16 at 03:30 AM ----------

Hi Rudi,...
2,918
Posted By am24
Hi pravin27, Thanks for the reply. I have...
Hi pravin27,

Thanks for the reply. I have modified the loop as you suggested. In the output , 2.979 placed in 20th field and 76.265 placed in 19th field.

So i just modified as below:

for...
2,918
Posted By am24
Hi Rudi, Thanks for the reply. I will try on...
Hi Rudi,

Thanks for the reply. I will try on this and will let you know.

Regards,
am24

---------- Post updated 05-12-16 at 02:52 AM ---------- Previous update was 05-11-16 at 03:52 AM...
2,918
Posted By am24
Inserting a field without disturbing field separator on other fields
Hi All,

I have the input as below:

cat input
032016002 2.891 97.109 16.605 27.172 24.017 32.207 0.233 0.021 39.810 0.077 0.026 19.644 13.882 0.131 11.646 0.102 11.449 76.265 23.735...
822
Posted By am24
Hi Rudi, I have also tried a similar kind of...
Hi Rudi,

I have also tried a similar kind of code but i faced a problem in checking for any of the fields in (5,6,7,8) is blank.

However the code given by you solved my problem. It worked...
822
Posted By am24
Condition on Fields
Hi All,

I am trying a shell script in which I come across the situation like below. I need some help on this.

My Input contains 40 fields. If the sum of the fields(5,6,7,8) is not equal to...
5,394
Posted By am24
Hi Ravinder, Thank you so much for the help....
Hi Ravinder,

Thank you so much for the help. I will be waiting for the response.

Regards,
am24
Showing results 1 to 25 of 71

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