Hello,
I am a chemist not familiar with awk, but I think awk can be very helpful for my problem. In fact I have a text file with coordinates parameters for thousand of compounds as follows:
-ISIS- 06130516212D
21 24 0 0 0 0 0 0 0 0999 V2000
-5.4833 1.5125 0.0000 N 0 0 0 0 0 0 0 0 0
5.0375 1.5125 0.0000 N 0 0 0 0 0 0 0 0 0
7.6667 -3.0458 0.0000 N 0 0 0 0 0 0 0 0 0
(etc.)
M END
> <IDNUMBER> (X10052)
X10052
$$$$
-ISIS- 06130516212D
18 19 0 0 0 0 0 0 0 0999 V2000
-4.1958 3.7000 0.0000 N 0 0 3 0 0 0 0 0 0
-8.1250 1.4250 0.0000 C 0 0 0 0 0 0 0 0 0
-4.1958 8.2375 0.0000 C 0 0 0 0 0 0 0 0 0
-12.0625 8.2375 0.0000 S 0 0 3 0 0 0 0 0 0
(etc.)
M END
> <IDNUMBER> (L10021)
L10021
$$$$
-ISIS- 06130516212D
16 17 0 0 0 0 0 0 0 0999 V2000
-0.3333 -1.2208 0.0000 C 0 0 0 0 0 0 0 0 0
-8.1625 -1.2208 0.0000 N 0 0 3 0 0 0 0 0 0
7.5000 -1.2208 0.0000 N 0 0 3 0 0 0 0 0 0
3.5833 -3.4792 0.0000 N 0 0 0 0 0 0 0 0 0
-4.2500 -3.4792 0.0000 N 0 0 0 0 0 0 0 0 0
-0.3333 3.3042 0.0000 O 0 0 0 0 0 0 0 0 0
-16.0000 3.3042 0.0000 S 0 0 0 0 0 0 0 0 0
(etc.)
M END
> <IDNUMBER> (B10023)
B10023
$$$$
and so on.......
Information for each compound is comprised between the terms "ISIS" and "$$$$", and what I need is to copy the number after the "IDNUMBER" term just in the first line of each compound, before the "ISIS" line (if not I am not able to read correctly the file with chemistry software).
Thank you in advance for your help/tips!
I am a chemist not familiar with awk, but I think awk can be very helpful for my problem. In fact I have a text file with coordinates parameters for thousand of compounds as follows:
-ISIS- 06130516212D
21 24 0 0 0 0 0 0 0 0999 V2000
-5.4833 1.5125 0.0000 N 0 0 0 0 0 0 0 0 0
5.0375 1.5125 0.0000 N 0 0 0 0 0 0 0 0 0
7.6667 -3.0458 0.0000 N 0 0 0 0 0 0 0 0 0
(etc.)
M END
> <IDNUMBER> (X10052)
X10052
$$$$
-ISIS- 06130516212D
18 19 0 0 0 0 0 0 0 0999 V2000
-4.1958 3.7000 0.0000 N 0 0 3 0 0 0 0 0 0
-8.1250 1.4250 0.0000 C 0 0 0 0 0 0 0 0 0
-4.1958 8.2375 0.0000 C 0 0 0 0 0 0 0 0 0
-12.0625 8.2375 0.0000 S 0 0 3 0 0 0 0 0 0
(etc.)
M END
> <IDNUMBER> (L10021)
L10021
$$$$
-ISIS- 06130516212D
16 17 0 0 0 0 0 0 0 0999 V2000
-0.3333 -1.2208 0.0000 C 0 0 0 0 0 0 0 0 0
-8.1625 -1.2208 0.0000 N 0 0 3 0 0 0 0 0 0
7.5000 -1.2208 0.0000 N 0 0 3 0 0 0 0 0 0
3.5833 -3.4792 0.0000 N 0 0 0 0 0 0 0 0 0
-4.2500 -3.4792 0.0000 N 0 0 0 0 0 0 0 0 0
-0.3333 3.3042 0.0000 O 0 0 0 0 0 0 0 0 0
-16.0000 3.3042 0.0000 S 0 0 0 0 0 0 0 0 0
(etc.)
M END
> <IDNUMBER> (B10023)
B10023
$$$$
and so on.......
Information for each compound is comprised between the terms "ISIS" and "$$$$", and what I need is to copy the number after the "IDNUMBER" term just in the first line of each compound, before the "ISIS" line (if not I am not able to read correctly the file with chemistry software).
Thank you in advance for your help/tips!