Loop through the parent and responses

Hi all,

here in the database we have discussion thread which we have to move the attachments in the documents into folders of specific path,

lets take example

AA-doc1,doc2

AA1-doc1,doc2

AA1.1-doc3,doc4

AA2-doc1,doc2

here i want to export the documents like this

in c:\attachmetns

i need to create a folder AA and extract the documents doc1,doc2

regarding AA1 i have to create a subfolder in AA and to extract doc1,doc2

regarding AA1.1 i need to create a subfoler in AA1

please let me know how we can achieve this, i think we need to write recursive function for this to create a folder

waiting for ur valuable responses

Subject: loop through the parent and responses

yes, you variant is appropriate.