Weird strings in a text file: how to avoid/remove them?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Weird strings in a text file: how to avoid/remove them?
I have a script generated file ,in my linux machine, which has got "<esc>"at the start of every line . It has also got "<esc>[36m>>><esc>[32m/main/1<esc>[m " like this at the end of every line. I am invonking the script that generates this file in my script. Now i need to remove all these occurences in this file from my ksh script. Please help me. absolutley clueless
This is not urgent for us, please do not demand priority attention from a voluntary community. instead you should provide a useful and informative thread title that gives information about the query you have.
I need to make the changes in the same file. This ends up with an empty file after the script ends. I need these changes made to be reflected in the file. Its like, i need to open this file, make these replacements and then save the file. Can you please help me with this ?
I have no idea what they are. This file is generated by a perl script that i invoke in my shell script. Please let me know how to remove those instances
yes. what you say is absolutely true. Its like a hidden control char only. you can imagine, each of these lines starting with <esc> . I am unable to paste it as such.
/vobs/dsl/APME/ape/tp/TP_IsamTopLevelTest.nash
/cm2/auto/testcases/Design/ESAM/ETH/ETH_IPV6_PROTOCOLFILTER/ETH_IPV6_PROTOCOLFILTER_18.ars
/cm2/auto/testcases/Design/ESAM/ETH/ETH_IPV6_PROTOCOLFILTER/ETH_IPV6_PROTOCOLFILTER_19.ars
/cm2/auto/testcases/Design/ESAM/ETH/ETH_IPV6_PROTOCOLFILTER/ETH_IPV6_PROTOCOLFILTER_21.ars
/cm2/auto/testcases/Design/ESAM/ETH/ETH_VLANTUNNEL_TRAF_ROBUST/ETH_VLANTUNNEL_TRAF_ROBUST_01.ars
/cm2/auto/testcases/Design/FTTU/SRV/SRV_QOS_DS_SHAPER/SRV_QOS_DS_SHAPER_NGLT_COMMON_PROCS.tcl
/vobs/esam/build/fulltests/COMMON/ATCSuppress.txt
/vobs/esam/build/fulltests/COMMON/datafile.tcl
/vobs/esam/build/fulltests/COMMON/TraceCMDLT.txt
Please give me some idea to remove that <esc> sequence
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.