Search Results

Search: Posts Made By: RavinderSingh13
319
Posted By RavinderSingh13
Hello sand1234, Following is the complete...
Hello sand1234,

Following is the complete explanation on same.

awk ' ##Starting awk command here.
{
ORS=length==80?"":RS ##Setting ORS by checking condition if...
319
Posted By RavinderSingh13
Hello sand1234, Here is the explanation of...
Hello sand1234,

Here is the explanation of it:

As you could see there are 2 %s written in printf which are connected to following.

%s -----> length($0)==80?ORS:""
%s -----> $0

1st one...
319
Posted By RavinderSingh13
Hello sand1234, Could you please try...
Hello sand1234,

Could you please try following(not tested though).

awk '{printf("%s%s",length($0)==80?ORS:"",$0)} END {print ""}' unwrap2.txt


Thanks,
R. Singh
319
Posted By RavinderSingh13
Hello sand1234, When I ran code for your...
Hello sand1234,

When I ran code for your samples it worked fine for me, if still it is giving no new line at last edit it like:

awk '{printf("%s%s",$0~/^[0-9]+/ &&...
319
Posted By RavinderSingh13
Hello sand1234, Could you please try...
Hello sand1234,

Could you please try following.


awk '{printf("%s%s",$0~/^[0-9]+/ && FNR>1?ORS:FNR==1?"":OFS,$0)}' Input_file


Output will be as follows.


2019 Sep 28 10:47:24.695...
Forum: What is on Your Mind? 1 Week Ago
375
Posted By RavinderSingh13
For me Dark Green color looks great :cool: :b: ...
For me Dark Green color looks great :cool: :b:
Thanks Neo for doing this.

Thanks,
R. Singh
317
Posted By RavinderSingh13
Hello akopocpoypoy, Or adding 1 more...
Hello akopocpoypoy,

Or adding 1 more approach where no need to hard code string again and again, simply keep a string into a variable Oct in this case and need not to change anything in code.
...
317
Posted By RavinderSingh13
Hello akopocpoypoy, Could you please try...
Hello akopocpoypoy,

Could you please try following.

awk '
{
while(match($0,/Oct [0-9]+/)){
val=sprintf("%s %02d",substr($0,RSTART,4),substr($0,RSTART+3,RLENGTH-3))
sub(/Oct...
307
Posted By RavinderSingh13
Hello shellnewuser, Could you please try...
Hello shellnewuser,

Could you please try following.


awk 'BEGIN{OFS=","} /\*\*\*END\*\*\*/{if(val){print val};print;val="";next} /^abc/{print;next} {val=(val?val OFS:"")$0}' Input_file

...
Forum: What is on Your Mind? 2 Weeks Ago
606
Posted By RavinderSingh13
Thanks a lot Neo for inviting such a great...
Thanks a lot Neo for inviting such a great experience and talent into forums :b:

Welcome aboard Nicki Paul in MODs group :b: :b:

Thanks,
R. Singh
544
Posted By RavinderSingh13
Hello dr_xemacs, Could you please try...
Hello dr_xemacs,

Could you please try following once.


awk '{while(match($0,/<[^>]*>/)){print substr($0,RSTART+1,RLENGTH-2);$0=substr($0,RSTART+RLENGTH)}}' Input_file


Thanks,
R. Singh
Forum: Shell Programming and Scripting 4 Weeks Ago
839
Posted By RavinderSingh13
Hello jcdole, Yes, that could be shorten to...
Hello jcdole,

Yes, that could be shorten to following.

MY_PATTERN="="
SOME_VAR=$(awk -F"$MY_PATTERN" '{split($1,array," ");print array[3]}' Input_file)
echo "$SOME_VAR"


Thanks,
R. Singh
144
Posted By RavinderSingh13
Hello mohdsadik90, We have different forum...
Hello mohdsadik90,

We have different forum for Homework and classroom work. Please go through that and fullfil all details for it and you will get appropriate guidance on your question.

Thanks,...
847
Posted By RavinderSingh13
Hello arunkumar_mca, Could you please try...
Hello arunkumar_mca,

Could you please try following too.

awk 'BEGIN{FS=OFS=";"} FNR==NR{a[$1]=$2;next} ($1 in a){print $0,a[$1]}' Input_file2 Input_file1


Thanks,
R. Singh
Forum: What is on Your Mind? 4 Weeks Ago
835
Posted By RavinderSingh13
Thanks a TON Neo for sharing it :b:, I am very...
Thanks a TON Neo for sharing it :b:, I am very very happy by seeing these results.

Thanks,
R. Singh
Forum: Programming 09-15-2019
243
Posted By RavinderSingh13
Regarding a GREAT site for understanding and Visualizing regex patterns.
Hello All,

While googling on regex I came across a site named Regulex Regulex´╝ÜJavaScript Regular Expression Visualizer (https://jex.im/regulex/#!flags=&re=%5E(a%7Cb%7Cc)(%5B%5E%40%5D*)%40(.*))
I...
Forum: What is on Your Mind? 09-06-2019
1,291
Posted By RavinderSingh13
Thanks a TON Neo for doing so :b: Welcome...
Thanks a TON Neo for doing so :b:

Welcome Yoda(one of my inspirations in scripting) to the MODs group :b:

Thanks,
R. Singh
Forum: What is on Your Mind? 09-03-2019
1,306
Posted By RavinderSingh13
Thanks Neo for doing so :b: Welcome to MODs...
Thanks Neo for doing so :b:

Welcome to MODs group Akshay :b:

Thanks,
R. Singh
864
Posted By RavinderSingh13
Hello mrcool4, On unix.com we encourage...
Hello mrcool4,

On unix.com we encourage users to post their efforts in their question which they have put in order to solve their own problems.
So kindly do so and let us know then.

Thanks,...
Forum: What is on Your Mind? 08-18-2019
1,928
Posted By RavinderSingh13
Thanks a TON Neo for doing this :b: Welcome...
Thanks a TON Neo for doing this :b:

Welcome to MODs group Peasant, you ROCK :b:

Thanks,
R. Singh
753
Posted By RavinderSingh13
Hello harveyclayton, Please post samples of...
Hello harveyclayton,

Please post samples of input and expected output along with what you have tried to solve your own problem.

Thanks,
R. Singh
1,806
Posted By RavinderSingh13
Hello ranjancom2000, We encorage users to...
Hello ranjancom2000,

We encorage users to post their efforts which they are putting to solve their own problem. Please always do add same in CODE TAGS.

Thanks,
R. Singh
2,437
Posted By RavinderSingh13
Hello cokedude, Could you please try...
Hello cokedude,

Could you please try following(I haven't tested it though).


awk '/dev/ && $5+0 > 70' Input_file


Thanks,
R. Singh
288
Posted By RavinderSingh13
Hello Adarshreddy01, IMHO that's because you...
Hello Adarshreddy01,

IMHO that's because you are passing output of cat file1 command to while loop which is considered as a new shell(or in other language creates a sub shell to execute while...
1,253
Posted By RavinderSingh13
Hello Vinod, When you see man page for ps...
Hello Vinod,

When you see man page for ps you see like.



So Rudi's code is actually comparing if a process is older then 7200 seconds which is 2 hours and if condition is TRUE it prints it...
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy