473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to dump data from a file into tree

Hello friends,
I am working on a problem where i need to dump huge amount of data from a file into a tree for analysis. The data in the file would be in specific format something like given below:

node1 child1 child2
child1 child3 child4
child2 child5 child6

Since there would be thousands of such lines i need a very optimised way to acheive it.
The format of the file could be modified depending upon the requirements.So can you please suggest the best possible method to achieve it.Are their any specific libraries that take input data from a file and dump it into a tree? Or do i need to write the routine to achieve it.

Regards,
Mukesh
Jun 29 '10 #1
2 2079
Jerry Winston
145 Expert 100+
I'm not sure about your data layout or I may be over simplifying the problem. Is the sample the EXACT format and content of the data in your data file or is there a more detailed root,node,leaf structure? If not, consider that each of your child# data elements carries a number(#) you can use to build your tree. A simple fn_addToTree(myTree,myValue,getNumberPart(myValue) ) function might do the trick.

fn_addToTree(myTree TreeDataType, myValue valueDataType, numberPart int)
Jun 29 '10 #2
weaknessforcats
9,208 Expert Mod 8TB
Are you using C++?

If so, consider using a map container. No point is writing tree code all over again.
Jun 30 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Parzival | last post by:
I have a package that includes some data files. I am planning to use a distutils setup script to install the package. How can I compute a path name for such a data file that will always be relative...
2
by: Domenico Discepola | last post by:
Hello all. Before my arrival at my current employer, our consultants physically set up our MSSQL 7 server as follows: drive c: contains the mssql engine drive d: contains the transaction log...
0
by: Auday Alwash | last post by:
Hi, A month ago, we were running out of disk space on a drive that stores the data file for a SQL Server 7 database. So I added a new drive and created a new data file on the primary filegroup...
7
by: Bob | last post by:
Hi, I am trying to use BULK INSERT with format file. All of our data has few bytes of header in the data file which I would like to skip before doing BULK INSERT. Is it possible to write...
3
by: piotrek | last post by:
Hi I would like to ask you a question. Ian creating app. that download from server directory structure ( whole tree ) and those data are placed in proper places into my treeview control. I...
2
by: nepdae | last post by:
Please forgive me, this is a long one. My 11-user Access 2000 database is having recurring corruption problems. The symptoms include the following: 1) corrupted fields in recently created or...
10
by: HardySpicer | last post by:
I have a cvs data file orbit.csv and found this code. function ReadFile() { var fso, f1, ts, s; var ForReading = 1; fso = new ActiveXObject("Scripting.FileSystemObject"); f =...
2
by: phpnoob | last post by:
I have a php script that processes a form and then posts the user input to a data file on the server in a comma delimited format. For simplicity call the file "data.csv." The script is working...
8
by: csharpula csharp | last post by:
Hello friends, I would like to know what is the best way to store a tree structure in c#? Are there any good implementation examples for seing how to do it? Thank u! *** Sent via...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.