I am reading data from packets and i need to store the data in a tree format in
a file... Is it possible ? what approach I should use?

It's possible, i suggest Xml because it can be used to store semi structured data that can be used across multiple DBMS'.

I used this approach for a recent project but can't manage to find the websites i used but it's nothing a bit of searching on Google won't find.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.