There is no escape character, there are however a carat with a left hand square bracket representing an escape - so is it a real escape character [0x]1B you need to be detected or is the carat good enough?
The ^[ is (not only) cat -v 's way to represent the ESC - char. Caret won't be good enough, won't work.
Let's wait for the requestor's attempts before we post valid solutions.
Hi neha_suri06,
If you want quick replies to your queries, and have those replies have a good chance of woking in your environment, it is crucial that you always tell us what operating system you're using, what shell you're using, and show us what you have tried.
Showing us the output from cat -v file gives us ambiguous data about what the actual contents are of the file named by file might be. If your sample input file has fields delimited by ASCII escape characters, we know that it contains at least two lines each containing somewhere between one and seven fields. To help us test code that might work to solve your problem, it is always better to include a copy of the data you want to process (in CODE tags) or upload a copy of the file itself. If there are questions about the data contained in a file, showing us the output from hexdump -C file (if it is available on your system) or od -bc file (which should be available on any UNIX or UNIX-like system) is always better than cat -v file because they both produce unambiguous output.
Refusing to answer questions about what you have tried and what you have considered trying makes it very clear that, despite what you said in your first post, this problem must not really be urgent for you.
Hi chandan.chaman and wisecracker,
As RudiC has already said, if you look closely at post #1 in this thread, you will see that the sample input show in that post is not the actual contents of the file named op.dat ; it is the contents of op.dat after processing by cat -v . From that output, we don't know if there are any circumflex characters in op.dat , but we do know that if there are any, they are data rather than being field delimiters.
If we knew that there are no circumflex characters in the first field in op.dat (which is not stated anywhere in neha_suri06's requirements but might be assumed from the given example), one could try the grossly inefficient:
cat -v op.dat | awk -F'^' '{print $1}'
Much better solutions could be suggested if we knew what operating system and shell neha_suri06 is using and had a better understand of what neha_suri06 had already tried to solve this problem.