Search Results

Search: Posts Made By: Rabu
6,287
Posted By Rabu
Thanks Ravinder for the explanation! And thanks...
Thanks Ravinder for the explanation!
And thanks for the heads up, MadeInGermany.

If my input file contains multiple fields (14), would there be any way of doing this for every even numbered field...
6,287
Posted By Rabu
Hi Ravinder, The code works great! ...
Hi Ravinder,

The code works great!

What does the "1" at the end of the code do?

Thanks,
Rabu
6,287
Posted By Rabu
Replace 0 with 1 in multiple fields with awk
Hello, I have the following input file:
1 3 3 2
3 3 4 0
4 0 5 4
5 2 2 0
5 3 4 0
6 0 3 2

I am trying to remove all zeroes in fields 2 and 4 and replace them with "1's"

I tried the...
1,842
Posted By Rabu
Hi Don and Scott, I apologize for not...
Hi Don and Scott,

I apologize for not clearly stating the problem, but say my actual input file contained 14 fields, and I only wanted to print all fields except for 6 and 7. Wouldn't a for loop...
1,362
Posted By Rabu
awk split help
Hello,
I have the following input file:

A=1;B=2;C=3;D=4
A=4;B=6;C=7;D=9

I wish to have the following output

1 2 3 4
4 6 7 9

Can awk split be used to do this?

I have done this...
1,842
Posted By Rabu
Hi, What I meant was that my actual file has...
Hi,
What I meant was that my actual file has the same format, but is much larger. It contains many more fields. I just put in three for the sake of simplicity.

There should be no space at the...
1,842
Posted By Rabu
awk for loop help
Hello,
I have an input file that looks like so:

1 2 3
4 5 6
7 8 9

and I just want to print the first and third column (note: my actual file contains many many more fields so I don't want to...
1,207
Posted By Rabu
Issue with grep
Hello, I have an input file that looks like so:
LDLR
LDLRAD4
VLDLR

when I grep "LDLR" I get an output of:

LDLR
LDLRAD4
VLDLR

Since all names have "LDLR" included within them, but all I...
903
Posted By Rabu
How to keep just one instance in input file?
Hello, I have the following dataset

1
1
2
2
2
3
3
4


I want to keep just one instance of each number seen:

1
2
3
4
7,703
Posted By Rabu
Print a specific length using awk
Hello, I have the following input data:

A C
AA GG
A G
CG AG

the code I tried:
awk -F" " '{ if ((length($1==1) && (length($2==1))) input_file

is not working, I need the output to be (such...
4,233
Posted By Rabu
Permutations with awk
Hello I have a very simple input file in which there are a list of numbers:

1
2
3
4
5
6
7
8
9
10

My actual dataset is about 200 lines long. I was wondering how to add different...
3,339
Posted By Rabu
Dividing values within rows with awk?
Hello everyone, I have a dataset that looks like:

1 2
3 4
5 6

I was wondering if was possible to divide values within rows:
1/2
3/4
5/6

I don't think using awk -F"\t" '{ print $1/$2 }'...
6,666
Posted By Rabu
Remove rows containing commas with awk
Hello everyone, I have a dataset that looks something like:

1 3
2 2
3 4,5
4 3:9
5 5,9
6 5:6

I need to remove the rows that contain a comma in the second column and I'm not sure how to go...
Showing results 1 to 13 of 13

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