Search Results

Search: Posts Made By: ratheeshjulk
2,122
Posted By vgersh99
could probably be simplified a bit, but it's a...
could probably be simplified a bit, but it's a start...
awk -f rath.awk wevlogFile where rath.awk is:

BEGIN {
FS=OFS="|"
fA[4];fA[5]
}
function uniq(f, s,a,at,i)
{
s=""
...
2,122
Posted By Don Cragun
Hi ratheeshjulk, On my system, with the sample...
Hi ratheeshjulk,
On my system, with the sample input provided in post#1 in this thread, vgersh99's code produces the output:
abc|xyz|123|agentcode=sample code abcdeeess|agentadd=abcd stereet 23343...
6,227
Posted By Scrutinizer
Try: ps axo...
Try:
ps axo user,pid,ppid,pcpu,%mem,vsz,rss,tt,stat,start,time,command
6,227
Posted By shamrock
ps -eo...
ps -eo cmd,user,pid,ppid,pcpu,pmem,vsz,rss,start,stat
Forum: Linux 03-10-2014
3,335
Posted By jlliagre
These are just thumb rules to start with. The...
These are just thumb rules to start with. The real rule is simple, the swap should be large enough to avoid being out of swap and might be much larger with no negative effect. This is essentially...
Forum: Linux 03-11-2014
3,335
Posted By Perderabo
The virtual addresses add up to about 6 GB. The...
The virtual addresses add up to about 6 GB. The resident memory is about 2 GB.

If a program allocates a 5 GB array its virtual address space utilization instantly increases by 5 GB because...
Forum: Linux 03-15-2014
3,335
Posted By jlliagre
If the CPU is fully utilized, the performance...
If the CPU is fully utilized, the performance slow down linearily with the extra load.
If the RAM is fully utilized, SWAP will start to be used. The performance might slow down much more intensively...
1,707
Posted By Yoda
Another awk approach: awk ' !(n) { ...
Another awk approach:
awk '
!(n) {
n = sub ( />\$ABCD</, ">$XXXXXX<" )
}
n {
sub ( />ABCD</, ">XYZZ<" )
sub ( />\$ddd</,...
1,707
Posted By Corona688
$ cat subrecord.awk BEGIN { RS="<"; ORS="<";...
$ cat subrecord.awk

BEGIN { RS="<"; ORS="<"; P=1 }

NR==1 { printf("%s",ORS); }
FNR==1 && (!$1) { next }

NR==FNR { D[++L]=$0; next }
/^SubRecord>/ {
T++;
if(T == 2)
...
4,901
Posted By itkamaraj
check this. But the below will match the...
check this.

But the below will match the incorrect date also ( eg. 88/99/99 xx:xx:xx )

check the regex pattern and correct it


nawk '{if(match($0,"[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]...
4,901
Posted By itkamaraj
ok. make it simpler nawk -F: -v OFS=":"...
ok. make it simpler


nawk -F: -v OFS=":" '{$1=substr($1,length($1)-10,11)}1' input.txt
1,108
Posted By rdcwayx
Looks like movie's subtitles. gawk -v i=30 ...
Looks like movie's subtitles.

gawk -v i=30 'function t(x){ split(x,a,":|,")
str=mktime("2011 1 1 " a[1] FS a[2] FS a[3])+i
return strftime("%H:%M:%S",str) "," a[4]}
...
1,357
Posted By itkamaraj
$ perl -lane 'if($_ =~ /[AP]M$/){print $_ ....
$ perl -lane 'if($_ =~ /[AP]M$/){print $_ . "\{\}";}else{print $_}' infile
22113350444356|Status:Assigned,Notes:
APP PRD |Sep 28 2011 12:12:55:660PM{}
22113350398356|Status:Assigned,Notes:
APP...
1,357
Posted By radoulov
Yes, it appends {} to the lines ending by a...
Yes,
it appends {} to the lines ending by a semicolon, 3 digits and 2 word characters:

\d{3} - 3 digits
\w{2} - 2 word characters
$ - end of line
1,357
Posted By radoulov
perl -i -pe's/:\d{3}\w{2}$/$&\{\}/' infile
perl -i -pe's/:\d{3}\w{2}$/$&\{\}/' infile
1,604
Posted By yazu
You have not any lines with 8 fields. But awk...
You have not any lines with 8 fields. But
awk -F, -vN=8 '
NF == N { print > "file1" }
NF != N { print > "file2" }
' INPUTFILE
1,604
Posted By zaxxon
Example has up to 9 columns. $> awk -F,...
Example has up to 9 columns.


$> awk -F, 'NF==9 {print > "file_1"; next} {print > "file_2"}' infile
$> cat file_1
a,s,d,f,g,h,j,k,l
1,2,3,3,4,5,6,7,6
$> cat file_2
a,2,3
4,5,6,7
4,559
Posted By getmmg
-0lne reads the whole file. s/\n//g replaces...
-0lne reads the whole file.
s/\n//g replaces all new line charecters and makes it into a single line.

print "$1\n" while /(.*?{})/g' this will try to do a minimalistic pattern match for any...
4,559
Posted By getmmg
If {} marks the end of line, try this ...
If {} marks the end of line, try this


perl -0lne 's/\n//g;print "$1\n" while /(.*?{})/g' input file.
Showing results 1 to 19 of 19

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