Search Results

Search: Posts Made By: ashokvpp
10,017
Posted By Scrutinizer
You are right of course. That was a copy-paste...
You are right of course. That was a copy-paste error :(
10,017
Posted By Aia
perl -pe 's/(\w+)/"$1",/g' ashokvpp.file ...
perl -pe 's/(\w+)/"$1",/g' ashokvpp.file

Output:
"00000119EEEC3F25", "feedoor", "20171103",
"0000011A4F152077", "feedard", "20171024",
"00000191FA295F61", "feedzipperhola", ...
10,017
Posted By MadeInGermany
The * (match zero or more) is problematic here. ...
The * (match zero or more) is problematic here.
The proper replacement for \+ is \{1,\}
sed 's/[^[:blank:]]\{1,\}/"&",/g' file.txt--
The following variant adds quotes and comma only if not yet...
10,017
Posted By Scrutinizer
Also try: sed 's/[^[:blank:]]\{1,\}/"&",/' file...
Also try:
sed 's/[^[:blank:]]\{1,\}/"&",/' file


--
GNU sed:
sed 's/[^ \t]\+/"&",/g' file
10,017
Posted By RudiC
Be it as it may - try sed...
Be it as it may - try
sed 's/[[:space:]]\+/",&"/g; s/^/"/; s/$/",/' file
10,017
Posted By Scott
A sed one: sed 's/ /", ...
A sed one:

sed 's/ /", "/g;s/^/"/;s/$/"/' file
10,017
Posted By RavinderSingh13
Hello ashokvpp, Could you please try...
Hello ashokvpp,

Could you please try following and let me know if this helps you.
Solution 1st: In case you don't want TAB as delimiter then following may help you.

awk...
2,538
Posted By jim mcnamara
BEGIN {err=0} mailq | awk ' /alerts/...
BEGIN {err=0}
mailq | awk ' /alerts/ {q_id=$1; next}
/quota/ {err=1;next }
(err==1) { print q_id, $(NF); err=0}'



Try that - what you need is to...
2,538
Posted By Yoda
Here is something based on assumptions:- mailq...
Here is something based on assumptions:-
mailq | awk '/^[^ ]/&&!/^\(/{q_id=$1;next}NF&&!/^\(/{print q_id, $1}'
1,223
Posted By apmcd47
You are using join wrong in the above example....
You are using join wrong in the above example. Join needs a list or tuple of strings:>>> '-'.join(('north','east','south','west'))
'north-east-south-west'

Alternatively use the add (+) operator:...
1,375
Posted By Skrynesaver
hn.rstrip("\n\r") in order to lose the new line...
hn.rstrip("\n\r") in order to lose the new line character
2,945
Posted By Akshay Hegde
Try [akshay@localhost tmp]$ cat f ...
Try


[akshay@localhost tmp]$ cat f
#160814 20:43:00 server id 2 end_log_pos 169934694 Query thread_id=8927407 exec_time=0 error_code=0
use sun_final/*!*/;
SET...
2,945
Posted By RavinderSingh13
Hello ashokvpp, Please use code tags for...
Hello ashokvpp,

Please use code tags for Inputs/commands/codes into your posts as per forum rules. Could you please try following.

awk '{match($0,/^#[0-9]+...
2,945
Posted By Akshay Hegde
Try Input [akshay@localhost tmp]$ cat...
Try

Input

[akshay@localhost tmp]$ cat file
#160814 20:43:00 server id 2 end_log_pos 169934694 Query thread_id=8927407 exec_time=0 error_code=0
use sun_final/*!*/;
SET...
1,690
Posted By Don Cragun
If you don't care about different dates being...
If you don't care about different dates being lumped together in the output, you could also try something like:
awk '{split($4,T,":");c[$1","T[3]":"T[4]]++}END{for(i in c)print c[i]","i}'...
1,690
Posted By RudiC
Try awk '{split ($4, T, ":"); print $1," ",T[3]...
Try awk '{split ($4, T, ":"); print $1," ",T[3] ":" T[4]}' file | sort | uniq -c| sort -nr | head -n20
1 192.168.10.6 14:40
1 192.168.10.32 47:57
865
Posted By 24ajay
You can try this for accurate result
cat file1 | awk -F"[=;]" '{ print $2,$NF }' | cut -c 1-5," ",13-16
865
Posted By anbu23
awk -F"[=;]" ' { printf("%.2f %.2f",$2, $NF) }...
awk -F"[=;]" ' { printf("%.2f %.2f",$2, $NF) } '
865
Posted By anbu23
awk -F"[=;]" ' { print $2, $NF } '
awk -F"[=;]" ' { print $2, $NF } '
1,665
Posted By Scott
What have you tried and where are you stuck?
What have you tried and where are you stuck?
1,665
Posted By Yoda
awk '!A[$0]++' test.txt
awk '!A[$0]++' test.txt
1,665
Posted By RudiC
@Yoda: that might be dangerous as might remove...
@Yoda: that might be dangerous as might remove single lines that could be duplicates of other records. I have to admit this is a remote possibility. Still, you can make it safer adding sth like ...
1,341
Posted By Jotne
check=("$(/usr/local/bin/chk_nag | awk -F:...
check=("$(/usr/local/bin/chk_nag | awk -F: '{print $1}')" "$(/usr/local/bin/chk_kas | awk -F: '{print $1}')" "$(/usr/local/bin/chk_was | awk -F: '{print $1}')")
1,341
Posted By pravin27
for ((i=0;i<${#check[@]};i++)) do ...
for ((i=0;i<${#check[@]};i++))
do
echo ${check[$i]}
done
Forum: IP Networking 03-13-2013
2,773
Posted By DGPickett
It seems like you should have a virtual IP or use...
It seems like you should have a virtual IP or use a router box, so the path is not in your hair. You are forwarding to the IP of one path, and if it is down, I am not sure routing will get there by...
Showing results 1 to 25 of 31

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