Search Results

Search: Posts Made By: cdfd123
2,483
Posted By cdfd123
awk to substitute third column if first column is greater than interest
A file

2400 2800 PSC000289
3200 3896 PCS000289
3333 3666 PCS000221
222 1000 PCS000222
3299 3600 PSC000289



Question is while if third column is PCS000289
and first column...
903
Posted By cdfd123
sed "s/\./ /g" file | awk '{print $1,$2}'|sed "s/...
sed "s/\./ /g" file | awk '{print $1,$2}'|sed "s/ /./g"


Actually u can try with more simpler code but this can work too
63,316
Posted By cdfd123
awk to print first row with forth column and last row with fifth column in each file
file with this content




awk 'NR==1 {print $4} && NR==2 {print $5}' file

The error is shown with syntax error; what can be done
739
Posted By cdfd123
The output is 1 as this sampled data contain all...
The output is 1 as this sampled data contain all three "LRR", "LOW", "HIGH" in a file.

But if you have the sampled data like this
45 BCD 777 HIGH pred IJJ
77 GYH 88 LOW pol KKK

Then...
739
Posted By cdfd123
a column containing multiple patterns perl
If U have a question
if a file is
33 ABC 276 LRR pir UJU
45 BCD 777 HIGH pred IJJ
67 BGH 66 LRR_1 prcc KIK
77 GYH 88 LOW pol KKK






perl -lne '$a++ if /LRR/,/LOW/, /HIGH/;...
1,722
Posted By cdfd123
---------- Post updated at 06:13 AM ----------...
---------- Post updated at 06:13 AM ---------- Previous update was at 06:12 AM ----------



U r Right
fgrep is faster here while running this compared as comapred to grep
Thanks
1,722
Posted By cdfd123
compare two files and search keyword and print output
You have two files to compare by searching keyword from one file into another file

File A
23 >pp_ANSWER
24 >aa hello [Beta done ]
25 >jau head wear [John mayor]
66 >jss oops...
726
Posted By cdfd123
find with given number and express output
file A
eebbbeeeeee


file B
4

Question is by file B and look into file A
output is b


awk -v v1=4 file B or something else
15,536
Posted By cdfd123
awk 'BEGIN { while (getline<"file2") {...
awk 'BEGIN { while (getline<"file2") { arr[$0]++}} { if(!($0 in arr)) {print}}' file1

That is the code almost like that of Franklin ....
980
Posted By cdfd123
counting the numbers in a row
File A

aa <space> --D--A--D---DDY---M--UM-M--MY


Another file

D3
M9


So output shud be
Here in FileA D which is 3 after removing dash
after we have counted dash D is...
2,203
Posted By cdfd123
Fill the empty line by adding line before blank line
FIle A

"A" 2 aa 34
3 ac
5 cd
"B" 3 hu 67
4 fg
5 gy


output shud be

A"" 2 aa 34
"A" 3 ac 34
"A" 5 cd 34
"B" 3 hu 67
"B" 4 fg...
1,555
Posted By cdfd123
Group on the basis of common text in the square bracket and sorting
File A


99 >ac [John 2] >ss[John 2] >juk[John 2]
70 >acb[Mona 3.1] >defa[Mona 3.1]
90 >ca[John 2]
100 >aa[John 2] >abc[John 2] >bca[John 2]
85 >cde[Mona 3.1]
81 >ghi[Rambo] >ghij...
1,141
Posted By cdfd123
if separate output need be created then what can...
if separate output need be created then what can be the option

like file A-1,fileA-2 etc...
1,141
Posted By cdfd123
split on the basis of 2nd and 3rd column
file A

aa 22 48
ab 22 48
tcf 50 76
gf 50 76
h 89 100
yh 89 100

how can we split the file on the basis of common 2 and third column
output like

file A-1
aa 22 48
ab 22 48
...
2,537
Posted By cdfd123
awk subtraction and print output
FileA
F97S 83 530
K569E 531 736

output shud be
F16S
K40E

it is code

sed 's/[A-Z]//g' FileA |awk '{print $1-$2+2}'
it will print
16
40
anything can come with this output??
1,473
Posted By cdfd123
actually same output will print while running...
actually same output will print
while running this awk code but second line have been removed but not still
>answer is the predicted other than >bigger than two
CGAHHAWWASSASS
SASAWEDSASSDDD...
1,473
Posted By cdfd123
awk to start with symbol and print next
File A


>answer is the predicted other than >bigger than two
>whatever isthere >out of mind
CGAHHAWWASSASS
SASAWEDSASSDDD
SSDDDEDEUJUYYS
>hello you are there other is what is that>you are...
1,829
Posted By cdfd123
calculation using awk or shell script in between the numbers
file A
E969K
D223L
E400L
E34L

file B
predicted 3
1 250
251 500
501 1000

The output should be
E969K 501 1000
D223L 1 250
E400L 251 500
E34L 1 250

I tried in this...
1,723
Posted By cdfd123
Match and count the number of times
ile1

Beckham

Ronaldo

file2

Beckham Beckham_human

Ronaldo Ronaldo_spain

Ronaldo Ronaldo_brazil

Beckham Beckham_manch

Zidane Zidane_Fran

Rooney Rooney_Eng
Output shud be
1,276
Posted By cdfd123
hope this reply
actually say
the one file is

kiss kisser
kill killer
asser ass

second file
kisser kiss
kill killer
hum hummer

difference of two files and also whether kiss and kisser is in $1,$2...
1,276
Posted By cdfd123
Print the difference
Suppose u have two files

One file
aa bb
aa cc
aa uu

second file
aa cc
cc bb
uu aa

so to print the difference between to files
i shud get cc bb
What can be done
1,253
Posted By cdfd123
That I have tried using this code ...
That I have tried using this code

#!/usr/bin/perl

$data_file="aa1";
open(DAT, $data_file) || die("Could not open file!");
@raw_data=<DAT>;
close(DAT);

#print $raw_data[0];
...
1,253
Posted By cdfd123
Program for pairing together to print outputusing perl
Suppose u have One file

one row and one column

A1 A2 A3 A4
A1
A2
A3
A4

And another Second file shows pairing

A1 A4
A2 A3
A2 A4
A1 A3

Want the output to be like...
1,280
Posted By cdfd123
reply
it can be sorted on the based of alphabets also

sort -n file it will be ok

otherwise if alphabets and number is there how can be that
that is a question?
1,280
Posted By cdfd123
how to sort
if u have a file

C22S
E2S
S2227
T24R
A12P

so i want that in sort so that

E2S
A12P
C22S
T24R
S2227
what can be the option
Showing results 1 to 25 of 133

 

Featured Tech Videos

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