I have big ascii files and I want to convert few characters (strings) to some other strings.
I have tried to do this in matlab but it takes ages.
Could you please give me some candidate script language (perl? python?) that is better for handling ascii files?
To change all occurences of a single character, use “tr”.
To change all occurrences of particular strings, use “sed”
It all depends on what you exactly want to do, but Unix/Linux has different small tools to do things like that.
Translating single characters (like convertiing all occurrencies of ‘d’ in ‘e’ and more of those in one go:
More sophisticated changes with vi commands in the stream editor:
-----BEGIN PGP SIGNED MESSAGE-----
Stream Editor (sed) is probably the best for something like this.
Examples of what you want to change from and to may help give an exact
On 06/06/2011 09:36 AM, alaios wrote:
> Dear all
> I have big ascii files and I want to convert few characters (strings)
> to some other strings.
> I have tried to do this in matlab but it takes ages.
> Could you please give me some candidate script language (perl? python?)
> that is better for handling ascii files?
> Best Regards
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----