Search Results

Search: Posts Made By: chitech
1,420
Posted By chitech
Monitor file if match then send mail
Hi

I want to monitor a file even if the file rotate. When a text occurs I want to send a mail.

Something like this but it's not working correctly:


tail -F mylog.log | grep 'MatchMe' |...
12,480
Posted By chitech
Split string into map (Associative Array)
Hi

Input:
{ committed = 782958592; init = 805306368; max = 1051394048; used = 63456712; }

Result:
A map (maybe Associative Array) where I can iterate through the key/value. Something like...
4,847
Posted By chitech
Regex: Get the word before match
Hi

Input:

MYTEXT.aa.bb
cc.MYTEXT.aa.bb
ee.dd.cc.MYTEXT.aa.bb
cc.NOTEXT.a.b


Output:

<empty>
cc
cc
<empty>


I would like to use a regex to extract the last word before MYTEXT...
2,236
Posted By chitech
The language is not important but defining the...
The language is not important but defining the steps like you suggested
2,236
Posted By chitech
Great solution. Thx
Great solution. Thx
4,224
Posted By chitech
So the steps is: 1. all characters until the...
So the steps is:

1. all characters until the last - .*-
2. Create a backreference which does not match a dot \([^.][^.]*\)
3. from the first dot to the rest of the line .*
4. Replace...
4,224
Posted By chitech
I am looking for a general solution if possible....
I am looking for a general solution if possible. But grep/java will be fine.
2,236
Posted By chitech
Regex:search/replace but not for escaped character
Hi

Input:

-
--
---
----
aa-bb-cc
aa--bb--cc
aa---bb---cc
aa----bb----cc

Output:

.
-
-.
--
aa.bb.cc
4,224
Posted By chitech
Regex: Extract substring between 2 separator
Hi

Input:
aa-bb-cc-dd.ee.ff.gg
Output:
dd

I want to get the word after the last '-' until the first dot

I have tried with regex lookbehind and lookahead like this:
(?<=-).*(?=\.)

but...
1,797
Posted By chitech
Append lines for a specific pattern
Input:
09:43:46,538 INFO first text
10:45:46,538 INFO second
text
11:00:46,538 INFO third
more
text

Output:
09:43:46,538 INFO first text
10:45:46,538 INFO second text
11:00:46,538 INFO...
2,176
Posted By chitech
Sorry I have miss something in the input file. ...
Sorry I have miss something in the input file.

I don't think I can use sort and uniq

The new input:
some random text SELECT TABLE1 some more random text
some random text SELECT TABLE2 some...
2,176
Posted By chitech
Count number of match words
Input:
some random text SELECT TABLE1 some more random text
some random text SELECT TABLE2 some more random text
some random text SELECT TABLE3 some more random text
some random text SELECT...
2,986
Posted By chitech
Thx for both answers I can execute...
Thx for both answers



I can execute this:
sed 's/^.\{4\}/'"`date`"'/' inputfile

and get this result:
Wed Nov 17 22:21:40 CET 2010=some text
Wed Nov 17 22:21:40 CET 2010=some text
Wed...
2,986
Posted By chitech
Hex to decimal - Execute command for the matching part
Alo

I have this input:
0x10=some text
0x20=some text
0x30=some text

and want this output:
16=some text
32=some text
48=some text

I want to use a command to convert from hex to decimal...
1,784
Posted By chitech
Thx for the answer but it's not working...
Thx for the answer but it's not working correctly. All lines get 1 occurrence. But if I use this:

awk '{print $1}' inpufFile | sort | uniq -c | sort | awk '{print $2" "$1}'

I will get the right...
1,784
Posted By chitech
Uniq adresses with number of occurrence
Alo

I have a file with a lot of addresses where I want to list unique addresses and the number of theirs occurrence.

I have this input file:
0011bd09 ea 01 0b 04 ea 01 0b 38-bd 11 00 98 15 cb...
Showing results 1 to 16 of 16

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