convert rows to single row

Hi
I want to convert multiple rows ro single row ,I have tried with below one but I am not getting what I am expecting.Please any idea

a.txt

[a.s1.txt]
conn1=stg
conn2=dev
path=\xxx\a1.txt
fre=a

[a.s2.txt]
conn1=stg
conn2=dev
path=\xxx\a2.txt
freq=a


awk '/a/{ORS=" "}{print}END{print "\n"}' a.txt


[a.s1.txt] conn1=stg conn2=dev path=\xxx\a1.txt fre=a   [a.s2.txt] conn1=stg conn2=dev path=\xxx\a2.txt freq=a


I am expecting the below

[a.s1.txt] conn1=stg conn2=dev path=\xxx\a1.txt fre=a

[a.s2.txt] conn1=stg conn2=dev path=\xxx\a2.txt freq=a

Thanks,
Akil

Try this:

awk '$1=$1' RS= OFS=" " ORS="\n\n" a.txt

Hi
Thanks,Its working fine

Akil

---------- Post updated at 02:16 AM ---------- Previous update was at 02:09 AM ----------

Hi
Sorry ,I have got the below error when call this

awk '$1=$1' RS= OFS=" " ORS="\n\n" a.txt1
awk: Input line [a.Addr cannot be longer than 3,000 bytes.
The source line number is 1.

I found the problem,there is no space between s1.txt s2.txt lines,Please any idea how to create the space

[a.s1.txt]
conn1=stg
conn2=dev
path=\xxx\a1.txt
fre=a
[a.s2.txt]
conn1=stg
conn2=dev
path=\xxx\a2.txt
freq=a

Thanks,
Akil

Try:

awk '/\[/ {printf("%s%s",NR>1?"\n":"",$0);next}
{printf(" %s",$0)}
END{print ""}' file

Hi
Its workin fine.Thanks for your help

Thanks,
Akil

Hi
I want to add connection parameter value in each entry


[a.s1.txt]
conn1=stg
conn2=dev
path=\xxx\a1.txt
fre=a
[a.s2.txt]
conn1=stg
conn2=dev
path=\xxx\a2.txt
freq=a

EXPECTING O/P


[a.s1.txt]
conn1=stg
conn2=dev
path=\xxx\a1.txt
fre=a
connection=SRC
[a.s2.txt]
conn1=stg
conn2=dev
path=\xxx\a2.txt
freq=a
connection=SRC

Thanksinadvance
Akil