HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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