Removing Control characters
Amol Sonaikar
amol at kenati.com
Thu Jan 2 03:40:23 EST 2003
More information about the Python-list mailing list
Thu Jan 2 03:40:23 EST 2003
- Previous message (by thread): Removing Control characters
- Next message (by thread): Removing Control characters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have an output of an command line operation which is stored in file and it contains special characters. The file looks as below: -------------------------------------------------------------- --->TestCase Command: add-route dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 nexthop-ip 192.168.22.98 interface ppd0^G iprouting> add-route dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 ^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 n ^H^H^H^H^H^H^H^H^H^Hexthop-ip^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$bnet 22.12.23.44 subnetmask 255.255.255.255 nexthop-ip ^H^H^H^H^H^H^H^H^H^H^H192.168.2^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$.23.44 subnetmask 255.255.255.255 nexthop-ip 192.168.22 ^H^H^H^H^H^H^H^H^H^H^H.98 inter^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$netmask 255.255.255.255 nexthop-ip 192.168.22.98 interf ^H^H^H^H^H^H^H^H^H^H^Hace ppd0 Request timeout iprouting> --->TestCase Command: add-route dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 nexthop-ip 192.168.22.98 vlanid 992^G iprouting> add-route dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 ^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 n ^H^H^H^H^H^H^H^H^H^Hexthop-ip^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$bnet 22.12.23.44 subnetmask 255.255.255.255 nexthop-ip ^H^H^H^H^H^H^H^H^H^H^H192.168.2^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$.23.44 subnetmask 255.255.255.255 nexthop-ip 192.168.22 ^H^H^H^H^H^H^H^H^H^H^H.98 vlani^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H$netmask 255.255.255.255 nexthop-ip 192.168.22.98 vlanid ^H^H^H^H^H^H^H^H^H^H^H 992 Request timeout -------------------------------------------------------------------------------- If I print the line on using python script it will look like below. --->TestCase Command: add-route dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 nexthop-ip 192.168.22.98 interface ppd0 iprouting> $netmask 255.255.255.255 nexthop-ip 192.168.22.98 interface ppd0 Request timeout iprouting> --->TestCase Command: add-route dest-ip subnet 22.12.23.44 subnetmask 255.255.255.255 nexthop-ip 192.168.22.98 vlanid 992 iprouting> $netmask 255.255.255.255 nexthop-ip 192.168.22.98 vlanid 992 Request timeout -------------------------------------------------------------------------------------- Regards Amol
- Previous message (by thread): Removing Control characters
- Next message (by thread): Removing Control characters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list