Thank you Shell_Life and Mirni..
Mirni
For sed i am getting error when i use -i option
> sed -i 's/^[^|]*|//' FINAL.output
sed: illegal option -- i
Usage: sed [-n] [-e script] [-f source_file] [file...]
But i was able to use by redirecting it
sed 's/^[^|]*|//' FINAL.output > FINAL.output.new
But i dont want to create a temporary file. Do we have any option to edit within the same file.
Shell_life
Thanks, I was using wrong option. Is it possible to redirect the output to same file?
Well, that's what -i (in-place edit) of sed does. If your version of sed doesn't support it, then temporary file can be used, just like you did. You could do without, with a (rather obscure) construct: