1753657 Members
5757 Online
108798 Solutions
New Discussion юеВ

Re: File Editing

 
Renjus
Advisor

File Editing

Hi

I want to remove "^O" from a file

I removed "^L" using the command
#/bin/sed "s/^L//g" /home/fil1

which command will remove ^O?
3 REPLIES 3
Goran┬аKoruga
Honored Contributor

Re: File Editing

Hello.

Both sed and tr allow you to do this.

tr supports "\NNN" syntax to specify octal nubers.

sed understands "\cX" syntax to specify control characters (directly applicable to your scenario), as well as "\dXXX", "\oXXX" and "\xXX".

I recommend you read info pages for sed.

Regards,
Goran
Renjus
Advisor

Re: File Editing

/bin/sed "s/^O//g" /home/file1 using this command it is not filtering "^O" (CtrlO)

Example of the file is given below please help me..

1^O^FH^SL1^R^24052010^1^D^PNEC002
2^BH^1^8^24Q^
Goran┬аKoruga
Honored Contributor

Re: File Editing

Please read the documentation and make sure you understand it before repeating your question.

The solution is really trivial:

sed -e 's/\co//' ...

Goran