Charged fluid to anisotropic fluid distribution in general relativity