Hi all!
Let's say I have obtained this dataset from the ISI Web of Knowledge
...
PT J
AU Yousefi, Ramin
Muhamad, Muhamad Rasat
Zak, Ali Khorsand
TI The effect of source temperature on morphological and optical properties
of ZnO nanowires grown using a modified thermal evaporation set-up
SO CURRENT APPLIED PHYSICS
VL 11
IS 3
BP 767
EP 770
DI 10.1016/j.cap.2010.11.061
PD MAY 2011
PY 2011
TC 2
Z9 2
SN 1567-1739
UT WOS:000288183300097
ER
PT J
AU Ooi, C. H. Raymond
TI Conversion of heat to light using Townes' maser-laser engine: Quantum
optics and thermodynamic analysis
SO PHYSICAL REVIEW A
VL 83
IS 4
AR 043838
DI 10.1103/PhysRevA.83.043838
PD APR 29 2010
PY 2010
TC 0
Z9 0
SN 1050-2947
UT WOS:000290107500018
ER
...
This is just a snippet. I would like to place each entry (from PT J to ER is considered an entry) into a separate file according to year.. Therefore
PT J
AU Yousefi, Ramin
Muhamad, Muhamad Rasat
Zak, Ali Khorsand
TI The effect of source temperature on morphological and optical properties
of ZnO nanowires grown using a modified thermal evaporation set-up
SO CURRENT APPLIED PHYSICS
VL 11
IS 3
BP 767
EP 770
DI 10.1016/j.cap.2010.11.061
PD MAY 2011
PY 2011
TC 2
Z9 2
SN 1567-1739
UT WOS:000288183300097
ER
will be in the file named 2011 and so forth. I tried to do it with this
i=1990
while [ "$i" -lt 2011 ]
do
gawk '/AU/ , /'PY "$i"'/' savedrecs.txt savedrecs2.txt > "$i"
((i+=1))
done
where savedrecs are the files containing the raw data from the database but it won't work because gawk will just keep dumping to $i until it meets the right PY "$i"..
Any ideas? Thanks in advance..