Hello,
I have data in a file something like this -
UNB
+UNOA
:1+006415160:1+AR0000012360:ZZ+080701:0552+2++DELFOR++++T
'UNH+2+DELFOR
![Big Grin Smilie](https://www.unix.com/images/smilies/biggrin.gif)
:97A:UN
Here, the delimiters used are
+ ,
: and
' . I have a set of such files in which these delimiters vary from one file to another.
I am developing a shell script which needs to take certain values from fields in this file depending on their positions which I will be doing it with the help of cut command.
My problem is how to find these varying delimiters from file to file. Means, in every file , how can i find out what is the delimiter after UNB(here +) , after UNOA (here
![Smilie Smilie](https://www.unix.com/images/smilies/smile.gif)
or before UNH (here '). I will store them in variables & then search for my required fields.
Please help me. It is very urgent.