How to change a fields text_format for admin users, and show a plain_text for anonymous users? When a node with body text format as plain_text is posted by anonymous user , how do I change it to full_html when being edited by admin or authenticated user?

Is there anyway I can edit body fields text_format on the go? like through preprocessing or form hooks?

I also have cases where some of the nodes when edited by admin comes with "enable/disable richtext", and for some nodes, it does not show up.
I'm afraid what I assume you are trying to accomplish just isn't available to you because Drupal saves the text entered in a field unfiltered/as is; it then filters it when it is actually displayed or rendered.

So, if you enter for example:

&lt;b&gt;Hello world&lt;/b&gt; &lt;some html tag&gt;blah blah blah&lt;/end some html tag&gt;


in a text field, that exact content will be saved.

Then, when the entity is displayed, Drupal will look at the text format and if it's plain_text, it will output

Hello world blah blah blah


but if the text format is full html it will output (with minor exceptions)

&lt;b&gt;Hello world&lt;/b&gt; &lt;some html tag&gt;blah blah blah&lt;/end some html tag&gt;


but once again, in both instances whatever the user inputs will be stored in the database.

Of course, you could create a field that toggles some sort of "display the body with full html after an admin has verified its contents" that would be looked at and if set, display the entity with that field using full html, but until set, would just display it in plain text.