Hi all,
Can anybody think of a way to do this? I have a file with content like the following:
F_TOP_PARAM_VALUE[0]F_TOP_SOURCE[UD1]F_TOP_DEL_NOTIFICATION[N]F_DEST_ADDR[76849]F_TOP_DEL_TYPE
What I want to do is print out the value in the square brackets after F_TOP_SOURCE. So in this case I'd like to print UD1 for this line. The file contains multiple lines such as the above and the number of parameters listed in the file can change which means that F_TOP_SOURCE[???] won't always be the second paramter list - so I could have a file with two lines like:
F_TOP_PARAM_VALUE[0]F_TOP_SOURCE[UD1]F_TOP_DEL_NOTIFICATION[N]F_DEST_ADDR[76849]F_TOP_DEL_TYPE
F_TOP_ORIG[6547]F_TOP_PARAM_VALUE[0]F_TOP_SOURCE[PS1]F_TOP_DEL_NOTIFICATION[N]F_DEST_ADDR[76849]F_TOP_DEL_TYPE
Any ideas? The only thing I can be sure about is that "F_TOP_SOURCE" will always precede the value in the bracket that I want, and an "F" will always follow the bracket I want.
Nightmare!
Any help would be much appreciated. I think it's also worth noting that I didn't design the format of the file!
Thanks in advance