I have this on a file:
Structural Attributes: text
text_id [A]
text_lleng_tr [A]
text_lleng_or [A]
text_cpr [A]
text_for [A]
text_ftr [A]
text_indexador [A]
text_dif [A]
text_reg [A]
text_esp [A]
text_tem [A]
text_tipus [A]
text_data_or [A]
text_data_tr [A]
text_autor [A]
text_traductor [A]
text_titol_or [A]
text_titol_tr [A]
s
s_id [A]
enty
contrac
contrac_forma [A]
abr
date
p
Then I run this sed command on it:
sed -i "N;s/\[A\]\n/,/g" file
From which I get:
Structural Attributes: text
text_id , text_lleng_tr [A]
text_lleng_or , text_cpr [A]
text_for , text_ftr [A]
text_indexador , text_dif [A]
text_reg , text_esp [A]
text_tem , text_tipus [A]
text_data_or , text_data_tr [A]
text_autor , text_traductor [A]
text_titol_or , text_titol_tr [A]
s
s_id [A]
enty
contrac
contrac_forma , abr
date
p
So, as you can see there still are [A]+line jump left, if I run the sed command a second time on the same file the amount of [A]+line jump decreases, but I have to run the command 3 times for the [A]+line jump to disappear. So the question is, am I doing something wrong or what is the correct way to do it for the [A]+line jump to be replaced at once.