Search Results

Search: Posts Made By: jkl_jkl
1,747
Posted By jkl_jkl
awk/sed help
$ cat file
""
"""
"dasdd"
"fdsfs"Fsd"fs
"aa"sss"dsadd""


Is there a way using awk or sed to print the lines which contain 3 or more "

i.e. required output:


"""
"fdsfs"Fsd"fs...
2,577
Posted By jkl_jkl
Jean-Pierre, thank you so much, it worked. Thank...
Jean-Pierre, thank you so much, it worked. Thank you again.
2,577
Posted By jkl_jkl
How to achieve the req output, please guide.
How to achieve the req output, please guide.
2,577
Posted By jkl_jkl
Could anyone help me on this please. Thank you.
Could anyone help me on this please. Thank you.
2,577
Posted By jkl_jkl
I tried upto this $ awk '$2==0' file.txt...
I tried upto this


$ awk '$2==0' file.txt > file.txt.0
$ awk '$2==1' file.txt > file.txt.1

$ cat file.txt.0
7789 0
1223 0
4567 0
7789 0
7789 0
3445 0

$ cat file.txt.1
3445 1
7789 1...
2,577
Posted By jkl_jkl
awk help
Hi all,


Input file: file.txt
_____________________

7789 0
3445 1
7789 1
1223 0
4567 0
7789 0
7789 0
1212 1
3445 0
7789 1
3445 1


How can I get the output as:
1,456
Posted By jkl_jkl
awk/sed help
Is there any good way of converting the following line (space as delimiter)

172.22.22.122 xyz 2008-02-15 12:12:56 - s:a/x/c/v 0 53 ...................


to

...
8,016
Posted By jkl_jkl
Thank you era. Ya this worked
Thank you era. Ya this worked
8,016
Posted By jkl_jkl
key value : awk
Input file:


x=1
y=2
z=5



Is it possible using awk or anything to get the following output?


key=x|y|z
value=1|2|5


I can use two separate code lines using awk or cut (with tr)...
32,219
Posted By jkl_jkl
Thanks era.
Thanks era.
32,219
Posted By jkl_jkl
Thanks danmero, but still as I stated I have more...
Thanks danmero, but still as I stated I have more than 70 columns, so specifying each and every column name is something difficult for me.

i.e.


Name Age Sex ............ fldx bloodgrp ........
32,219
Posted By jkl_jkl
I feel I explained my query in a wrong way. Let...
I feel I explained my query in a wrong way. Let me explain again:

Input file:


$ cat log.txt
Name Age Sex Lcation nfld alias xsd
CC 25 M XYZ asx KK Y
BB 21 F XAS awe SS N
SD 21 M AQW rty...
32,219
Posted By jkl_jkl
Thanks for the replies. But the reason I...
Thanks for the replies.

But the reason I asked "based on column header" because I have more than 70 fields in the file (log.txt is just a sample) and field positions are not fixed. I can identify...
32,219
Posted By jkl_jkl
awk/sed column replace using column header - help
$ cat log.txt
Name Age Sex Lcation nfld alias xsd
CC 25 M XYZ asx KK Y
BB 21 F XAS awe SS N
SD 21 M AQW rty SD A


How can I replace the column with header "Lcation" with the column with...
1,767
Posted By jkl_jkl
Thanks all. It worked perfectly.
Thanks all. It worked perfectly.
1,767
Posted By jkl_jkl
awk sed help
$cat log.txt
#fld names
#Fld: Name Age Sex Lcation

CC 25 M XYZ
BB 21 F XAS
SD 21 M AQW


Output required:

Fld rec1 rec2 rec3
Name CC BB SD
Age 25 21 21
Sex M F M
Lcation XYZ XAS...
1,462
Posted By jkl_jkl
for/while
This is an example of one of my requirement:


$ cat any
A C F
D 4
A F C V

A)

$ while read line
> do
> echo $line
> done < any

A C F
D 4
A F C V

B)
6,287
Posted By jkl_jkl
era and ghostdog74 thanks a lot for your replies.
era and ghostdog74 thanks a lot for your replies.
1,484
Posted By jkl_jkl
awk help
how can I write a function in awk such that:

it accepts a int value

e.g.

f_my 2 (function f_my will add the NR to the last "two" fields of file.txt)

Presently without function, I am doing...
6,287
Posted By jkl_jkl
era, thanks a lot for your valuable reply. I...
era, thanks a lot for your valuable reply.

I have a query related to this


$ cat file.txt
AA
BB
CC
DD



$ cat my.sh
set -o nounset

diff=26
start=1

#Print random number between...
6,287
Posted By jkl_jkl
shell function, system, awk
Hi all,

I am calling a shell function within awk using system. I am struggling to get my expected output:


#!/bin/sh

set -o nounset
BEG=44
END=55

shfun()
{
echo "1|2|3"
}
...
10,224
Posted By jkl_jkl
Jean-Pierre, yes, this is what I was looking...
Jean-Pierre,
yes, this is what I was looking for. Thank you very much. It helped me a lot.
10,224
Posted By jkl_jkl
Thank you Summer_Cherry for your reply. But its...
Thank you Summer_Cherry for your reply. But its not printing the combinations of the values in the files as I stated.
10,224
Posted By jkl_jkl
Thanks to radoulov and Franklin for your replies....
Thanks to radoulov and Franklin for your replies.

Just to make my requirement simple.


$ ls /temp
one three two

$ cat one
1
2
3

$ cat two
4
5

$ cat three
6
7
10,224
Posted By jkl_jkl
Printing all combinations : Awk
$ cat key.txt
#ID1 Start
1|AA1
2|AA2
3|AA3
4|AA4
#ID1 Complete

#ID2 Start
1|BB1
2|BB2
3|BB3
#ID2 Complete


I was required this output:

AA1|BB1
AA1|BB2
AA1|BB3
Showing results 1 to 25 of 46

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