Request for advise on how to remove control characters in a UNIX file extracted from top command
Hi,
Please excuse for posting new thread on control characters,
I am facing some difficulties in removing the control character from a file extracted from top command,
i am able to see control characters using more command and in vi mode, through cat control characters are not visible
through cat -v i am able to see the control characters.
i tried with sed , tr -dc, od command (not sure how to handle this) nothing worked and thought of reading line by line and removing control characters but not sure how to remove the control characters, Could anyone please advise how to remove the control characters.
below is my file in vi mode having control characters
Thanks all of your input , Please excuse Skrynesaver i didnt see the note top -b d 3 command worked fine, through more , cat -v and vi i didnt see control characters,
Thanks i tried tr -d [:cntrl:] also it removes the caret symbol and character like [7m,[m[K[m,[m[m , i am able to see that i hope i can remove using sed command.
I tried
but didnt work , actually i am using ksh.
i tried using
-- command worked but still [* character was available ^ was removed.
and
Thanks All for your valuable inputs.
Thanks,
Regards,
karthikram
---------- Post updated 09-05-13 at 02:15 AM ---------- Previous update was 09-04-13 at 10:09 PM ----------
Hi ,
I am not sure, whether i can request for another query,
I need to take this output in html format i am unable to get $12 value which is the COMMAND value , if there is space it prints the start of the word and not printing the entire.
I am unable to find a way to
1. print the file in pipe separted so that i can send to html
2. i am unable to print the file in mail , where it is printing the whole file in single line.
I tried,
2. using while loop which array nothing is working to print line by line in the mail.
and the file is containing blank space after the 12th field COMMAND.
Please advise.
Thanks,
Regards,
karthikram
---------- Post updated at 02:56 AM ---------- Previous update was at 02:15 AM ----------
Hi,
1. To print the top command output file in mail , i tried the below , but writing the entire file in a single line.
2. To record the top command output file in html format, the 12th field COMMAND value which has space so while appending to html more number of rows are creating instead of 12 field expected.
and 1 more thing , file is containing blank space after 12th field.
and Is there any approach to get the top command output in pipe separated file.
Please advise how i need to workaround.
Thanks,
Regards,
karthikram
---------- Post updated at 10:11 AM ---------- Previous update was at 02:56 AM ----------
Hi,
could anyone please advise, i was trying to get top command file into html where 12th field containing space , i am not sure to frame exact awk to command to accomadate the value inside 12th field instead of more fields after it.
Thanks,
Regards,
karthikram
Last edited by Franklin52; 09-05-2013 at 03:41 AM..
Reason: Please use code tags
Hi Guys,
We receive some huge files on to Linux server. Source system use FTP mechanism to transfer these files on our server. Occasionally one record is getting corrupted while transfer, some control characters are injecting into the file. How to fix this issue ? please advice ?
Sample... (2 Replies)
Hello,
How can I view control and special characters of a text file?. For example, space, tabs, new line chars etc.
Can I use hexdump for it?
Thanks (3 Replies)
Hi,
My files are showing some control characters in vi editor
^M
^@ and somtimes
^H
I removed ^M with %s/^M//g command
but how to represent ^@ and ^H
e.g. for ^M it is hold ctrl then v and m..
Please help..
I am very new to unix.. (7 Replies)
Hi,
I am using Cygwin.I created a new file and type into it using cat > newfile. When I open this using vi editor, it contains loads of extra control characters.
Whats happening? (1 Reply)
There are 10 files present which have Ctlr-M characters appended to each line of all files.
I have a unix script which processes the files in a loop.
And there is an inner loop which processes each line in the file concerned.
#inputFile is a variable which has the file name of the input... (2 Replies)
Hi,
I have a .xml file in unix. We are passing this file through a xml parser.
But we are getting some control characters from input file and XML parser is failing for the control character in file.Now I am getting following error,
Error at byte 243206625 of file filename_$.xml:
Error... (1 Reply)
Can anyone seem to know how to find out whether a UNIX text file has 'hidden' control characters?
Can I view them using 'vi' by some command line options?
If there are control characters in a text file which are invisible/hidden.. then how do I get rid of them?
Your intelletual answers are... (6 Replies)
I have a file with millions of records...Before I experiment, I would like to know which one is faster.
Both the commands work absolutely fine on a smaller set of records.
Please advice.
sed 's/^M//g' ${INPUT_FILE} > tmp.txt
mv tmp.txt ${INPUT_FILE}
tr -d "\15" < ${INPUT_FILE} > ... (11 Replies)
Hi,
When I do a man and save it into a file, I end up getting a lot of control characters. How can I remove them??
I tried this:
/1,$ s/^H//g
But I get an error saying "no previous regular expression".
Can someone help me with this.
Thanks,
Aravind (5 Replies)