Search Results

Search: Posts Made By: Indra2011
7,540
Posted By Indra2011
It worked. Many many thanks
It worked. Many many thanks
7,540
Posted By Indra2011
Thanks RudiC. No awk is not must . Thanks a lot
Thanks RudiC. No awk is not must . Thanks a lot
7,540
Posted By Indra2011
Script to do column to row in awk
Hi ,

Can anyone help me suggesting - how to do the below trick with awk

Input


120
130
140
210
310
410
645
729
800

Output

120 130 140
3,350
Posted By Indra2011
Script to do column to row
Hi ,

Can anyone help me suggesting - how to do the below trick with awk

Input
100
120
130
140
210
310
410
645
729
800



Output
1,430
Posted By Indra2011
Script to separate file
Hi,
Could anyone help me with this please.

Input file --
ant 1 2 3 4
2 3 4 56 7
dog 8 9 56
ant 2 3 4 5
cvh 6 7 8
ant 1 3 45
78 0 -

Would like to split the file as soon as it...
4,066
Posted By Indra2011
Many many thanks. RudiC and Ravinder, I tried...
Many many thanks. RudiC and Ravinder, I tried your command with changing the shell to bash and it worked.
4,066
Posted By Indra2011
Linux and csh. ---------- Post updated at...
Linux and csh.

---------- Post updated at 02:17 AM ---------- Previous update was at 02:14 AM ----------

Second command is not the one I am giving. It is the getting displayed once I run your's...
4,066
Posted By Indra2011
Hi Ravinder, Many many thanks for help. This...
Hi Ravinder,

Many many thanks for help. This was what I get while running the code.

disco,mum $ awk '!$1{$1=OLD1} !$2{$2=OLD2} !$3{$3=OLD3} {OLD1=$1; OLD2=$2; OLD3=$3} 1' FS="," OFS="," test
...
4,066
Posted By Indra2011
Thanks R.Singh. It did not work. Is there...
Thanks R.Singh. It did not work.

Is there any other way we can do this by reading the input file first --

something like --

cat Input_File | awk "Your and Rudi's logic" .

Thanks
4,066
Posted By Indra2011
Hi Ravinder Singh, I am getting a syntax...
Hi Ravinder Singh,

I am getting a syntax error. Also, my error look like this


awk: file{$1=OLD1} file{$2=OLD2} file{$3=OLD3} {OLD1=$1; OLD2=$2; OLD3=$3} 1
awk : ^ syntax error

Please...
4,066
Posted By Indra2011
Hi RudiC, Will this code work?. Just...
Hi RudiC,

Will this code work?. Just included $3 component in your logic.

awk '!$1{$1=OLD1} !$2{$2=OLD2} !$3{$3=OLD3} {OLD1=$1; OLD2=$2; $3=OLD3} 1' FS="," OFS="," file

Thanks
4,066
Posted By Indra2011
Thanks a lot Rudi. You are right, the input file...
Thanks a lot Rudi. You are right, the input file was wrong. i have corrected it now. Will this code of yours even work now if i just include $3=OLD3 in your code.
4,066
Posted By Indra2011
How can we do this!?
Hi,

I have an input file which looks like

101,103,1,2,3
,,,2,3
,,,4,5
201,234,7,8,9
,,,4,5I would like top have output like, Is this possible?

101,103,1,2,3
101,103,1,2,3
101,103,1,4,5...
1,407
Posted By Indra2011
do we have anything with awk please?
do we have anything with awk please?
1,407
Posted By Indra2011
Logic shuffle
Hi,

Is there any way I can shuffle the numbers randomly. I have been trying to google and I found lots of 'generator' but is it possible to find the background logic to create randomness?
...
2,547
Posted By Indra2011
Thanks both of you. It worked .I wonder things...
Thanks both of you. It worked .I wonder things are so simple for you guys
2,547
Posted By Indra2011
UNIX trick or command
Hi,

Is there any command to do this --

Input is --
Ant
Bat
Cat
Dog

Output is --
A_Ant
B_Ant
A_Bat
B_Bat
A_Cat
B_Cat
A_Dog
B_Dog
11,713
Posted By Indra2011
Difference of Sort -n -k2 -k3 & Sort -n -k2,3
Hi,

Could anyone kindly show me a link or explain the difference between

sort -n -k2 -k3 & sort -n -k2,3

Also, if I like to remove the row with repetition at both $2 and $3, Can I safely...
1,644
Posted By Indra2011
Million Thanks Don.
Million Thanks Don.
1,644
Posted By Indra2011
Don, Many many thanks Don for your detailed...
Don,
Many many thanks Don for your detailed explaining. Excuse my lack of knowledge on this. I have couple of questions ---

1. what is c in this script?
2. what is this this logic for If c...
1,644
Posted By Indra2011
All of the Gurus, many thanks for your help ...
All of the Gurus, many thanks for your help

---------- Post updated at 03:41 PM ---------- Previous update was at 03:36 PM ----------

Hi Scrutinizer.

Could you be kindly explain what you did...
1,644
Posted By Indra2011
Script changing row to column
Hi Gurus,

I have an I/P file which looks like


100 1
200 1
300 4
100 2
200 3
300 4
100 9
200 8
300 7

I would liek to get O/P as

100 200 300
1 1 4
2 3 4
2,505
Posted By Indra2011
Many many thanks
Many many thanks
2,505
Posted By Indra2011
Script suggestion
I have a file which looks like

ant1 1,2,3,4 bat1
ant1 5,6,7,8 bat2

I would like to have an O/p as

ant1 1 bat1
ant1 2 bat1
ant1 3 bat1
ant1 4 bat1
ant1 5 bat2
ant1 6 bat2
ant1 7 bat2...
1,471
Posted By Indra2011
Many many thanks Don
Many many thanks Don
Showing results 1 to 25 of 167

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