Character screening and paste into newfile in columns instead of rows

QL10169_SAUJANA%SubNetwork=ONRM_ROOT_MO_R,SubNetwork=ERBS_KCRN11,MeContext=QL10169_SAUJANA_5
%External_Link_Failure
%X2_link_problem_to_one_or_several_neighbouring_eNodeBs.
QL10187_MATANG_JAYA_2%SubNetwork=ONRM_ROOT_MO_R,SubNetwork=ERBS_KUCHING,MeContext=QL10187_MATANG_JAYA_2_3
%External_Link_Failure
%X2_link_problem_to_one_or_several_neighbouring_eNodeBs.
QL10192_JLNKRUKUP%SubNetwork=ONRM_ROOT_MO_R,SubNetwork=ERBS_MRRN13,MeContext=QL10192_JLNKRUKUP_1
%External_Link_Failure
%X2_link_problem_to_one_or_several_neighbouring_eNodeBs.

Above is the example, i want to do something like below,
1.Check first character of everyline if it is not % then print in the new file.
2.Read secondline if it is "%", then it should paste into the 2nd column of the first line which already pasted.
3.like wise till end of the line.

Can someone pls help on this

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

Duplicate of this post.
Thread closed.