Thank you.. but i can got the wrong output and also did not work for Name field more than 1 word( ie. Andi ruby) and when the field has empty value
$ awk -V | head -1
GNU Awk 4.0.0
$ cat data.txt
Name = Andi
Address = none
Phone = 82728
Name = Peter
Address = none
Phone = 98799
$ awk -vfs=',' 'BEGIN{printf "%s%s%s\n","Name"fs,"Address"fs,"Phone";}{ \
if($0!~/^ *$/) a[++x]=$NF;else b[x]=x-1};END{for(i=1;i<=x;i++)if(i-1==b&&b!=0||i==x)printf "%s\n",a; \
else{printf "%s"fs,a}}' data.txt
Name,Address,Phone
Andi,none,82728, ,Peter,none,98799
it's working , i tried to understand the code but can not get in.. i tried to modified for form that contain more than 3 fields ( name, address, phone,email etc.) but can not get the output it's only display the 3 fields.
and
i modified code for other your requests(more than 1 word or empty)..
and i tried for gawk 4.0 but results are same as i think,
maybe your input file has contain different charset.
# cat testfile
Name =
Address = Oklahoma city
Phone = 82728
Name = Peter Surname
Address = none
Phone = 98799
Name = John
Address = NJ City
Phone = 10000
Name = Mr.Smith
Address =
Phone = 5555555 555555