Search Results

Search: Posts Made By: Balav
1,355
Posted By looney
Hi Balav, can we break this in two steps. by...
Hi Balav,
can we break this in two steps.
by sed and awk.
sed -i 's/"//g' file
awk 'BEGIN{print "user,phone,duration,login,ip_address";RS="";OFS=",";FS="="} { print $2 OFS $4 OFS $6 OFS $8 OFS...
1,355
Posted By Scrutinizer
If the records are separated by two newlines with...
If the records are separated by two newlines with no spaces and the fields are always in the same order, one could also try:
awk 'FNR==1{print $1,$3,$5,$9}{print $2,$4,$6,$10}' FS='[="\n]*' OFS=,...
1,355
Posted By RavinderSingh13
Hello Balav, Please use code tags as per...
Hello Balav,

Please use code tags as per forum rules for all commands/codes/Inputs which you are using into your posts. Following may help you in same.

awk -F"=" '/^user/ && A{A=A ORS;B=""}...
1,355
Posted By RavinderSingh13
Hello Bala, Apologies for not seeing that...
Hello Bala,

Apologies for not seeing that part, could you please try following and let me know if this helps you.

awk -F"=" '/^login/{next} /^user/ && A{A=A ORS;B=""}{B=B?B OFS...
10,484
Posted By Franklin52
Another approach: awk -F\" 'BEGIN{print...
Another approach:
awk -F\" 'BEGIN{print "Cust-Number,Cust-Name,Cust-Town,Cust-Purchase"}
/hobby/ || !NF{next}
/purchase/{print $2; next}
{printf $2 ","}
' file
10,484
Posted By RudiC
Let me quote Don Cragun for you:
Let me quote Don Cragun for you:
10,484
Posted By RudiC
Howsoever, tryawk -F= ' BEGIN ...
Howsoever, tryawk -F= '
BEGIN {HD = "Cust-Number,Cust-Name,Cust-Town,Cust-purchase"
print HD
HDCnt = split (HD, HDArr, ",")
...
Showing results 1 to 7 of 7

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