loading muliable table from a single file

This is a discussion on loading muliable table from a single file within the C++ Programming forums, part of the General Programming Boards category; ******sorry i typed table instead of textbox in the title********
ok im new to this forum so im sorry if ...

loading muliable textbox from a single file

ok im new to this forum so im sorry if i break any rule or that my post are baddly formateed.
ok here what im trying to do. i have a .txt file containing multiable pieces of data in this format:

Name "Jack"
surname "wilson"
Age"14"
etc. as well as single lines that assigned type info such as
unemployed
employeed
etc.
please note this is just a fake templete to show what the file is and how some of the data layed out, its not the way i would have done it, it just the way the current system stores data.
ok so my problem is that im trying to produce a simple program where it seperates out they lines into text boxes.

e.g.

in text box one would have a lable called "Name" and would contain "jack" and in another text box would contain "wilson".

now im told thazt this can be achieve though sometihng called parsing, which ofcause i nooded to pretend to know what that was, but i don't. so if anyone knows how to achieve the end i wish for could they please tell me or better yet direct me to a bit of example code that i could look at.

Also if it is possable i need the program to save it. so if i need to do something different to get it into a format im capable to save. please could someone point that out to.

Plz also note that my problem is not with getting the data or saving it. it is what i do with it oncve i've got it.

sry for bumping this thread, but alot is riding on this. I have posted on many forum and no-one has replied. I know very sad.

Is there a reason why no one has replied, e.g. noone understands my question, no one know the answer, i am asking the wrong question, am i asking in the wrong place or completely barking up the wrong tree.

any respone would be useful even if it to say i don't know.
I really need an anwser to this or could someone redirectly to a tutoral or an example code that does something simular

you say you need to break up the text in the files and place the strings in text boxes, and then save them.

if they're in a text file to begin with, they data has already been saved, so it is unclear what you wish to accomplish.

in your case, the basic process of parsing would go something like this:

open the file
read a line
determine what data is in the line (either by a constant order (e.g. every Nth line is first name) or a data identifier (e.g. Name), and if applicable, identify data substring from identifier and whitespace

this is extremely general, but it doesn't seem possible to be more specific with the information you provided.

also, unless you really have to use C++ for this, i'd recommend using a scripting language like PHP or perl.

i need to use C++ (well C.net) because the program i have created for it, i did in C.net and is a very large program that i don't particulary want to recode in php.

What i need to do is worki out how to seperate a string, which i load from a text file that look like i said.

The perpose of the program is look up data, edit it, then save. the problem im have is that i've never done anything with C.net before and im self teaching myself as i go along. and i have been looking for a way to do this, but with out knowing what im looking for im pritty stuck.

What would be very useful is a tutoral or an example Piece of code which haddle the seperating of the string and if you could point be in the direction i would be helpful.

what you really need is a database. that is exactly what they are for...

there's no single answer on how you do something like this. you may be looking for a shortcut where one simply doesn't exist. you're going to have to analyze the text information yourself by breaking the lines into words and/or characters and implementing the appropriate logic to store each piece of information.

i would love to use a db, unforanly the system this is a no go, cause the files i am accessing are create and are used by a current file system my company uses, the perpuse of the program i am creating is to sort of sort sut the current system and allow me to access it remotly etc.

you're going to have to analyze the text information yourself by breaking the lines into words and/or characters and implementing the appropriate logic to store each piece of information.

i know this, i was just under teh impresion that i could do this with out a masive If statement, at the very least i would like a way to break up each line into seperate strings, the rest i can sort out myself

i know this, i was just under teh impresion that i could do this with out a masive If statement, at the very least i would like a way to break up each line into seperate strings, the rest i can sort out myself

> now im told thazt this can be achieve though sometihng called parsing, which ofcause i nooded to pretend to know what that was
Mmm - kay...

> but alot is riding on this
Such as?

> cause the files i am accessing are create and are used by a current file system my company uses
Ah, now it becomes clearer.

I'm seeing someone who managed to blag a job they're totally incapable of doing, and the company is just about to realise it by giving you this simple assignment. It's bad enough dealing with the free homework crowd, nevermind the free job crowd.

Fess up, resign from the job you can't do and find something easier in life.
Or pay half your salary to some eager beaver at www.rentacoder.com

uhhh...whoever is in charge of IT/software at your company deserves to be boiled in oil.

or at least fired.

This is true, only problem is that some tit higher up desided to out source all our IT on a five year contract, which in other words means that i all our system are now 3 years out of date (we are 3 years into contract) and have no been touched or updated since except to get them barlly running again. problem is that the way we do busness has changed so we need to add new thing to the system (which of cause the contractor won't unless paid &#163;&#163;&#163;&#163;&#163; which we can afford. So my boss has come to me and said can your sort this out for me and i thought "yeah, why not i have some Coding knowage i should be able to get by" which i would like to point for someone who has not used C.net beofe or even any C langwage, i have produce quite an impressise program that does anything i need i just did not know how to do this one thing, i could not for the life of me work out how or what to look for, So i asked online to which i get this reception.

I'm seeing someone who managed to blag a job they're totally incapable of doing, and the company is just about to realise it by giving you this simple assignment. It's bad enough dealing with the free homework crowd, nevermind the free job crowd.

Fess up, resign from the job you can't do and find something easier in life.
Or pay half your salary to some eager beaver at www.rentacoder.com

Im sorry i did not realised i would affend by asking for help, your right what an odd thing to do, to need help with something and to come to a form design to help people like me and other solve problem they have. How silly of me. And as for the 'free job crowd' i've have been working here a year and a half and been promoted twice. I do my job very well and get pay acordingly. And yes my spelling is very poor but half the people working in the computer industry are the same.

So read about strchr() and strtok() already.

THANK YOU, Now was that so hard, it is all i wanted was to be pointed at the infomation so i could work it out myself.
thank you Tabstop, I have now got a ruff idea on how to do this and should be fine.

Just to give you a ruff idea of how bad the Contractors are. The main reason they were hired was to create and maintain at system that would allow us to have people place orders online and to link all our, what was then a compete paper based system into one overall linked system that could be access from anywhere. And at least half of the system they built us is driven by 'Lookup fields'( please note i have blank the formention word, because it is eveil and may offend people who are sensative to baddly made databases).

Oh and just so you know the guy who agreed to the contract was fired. but not for this mistake. he was fire for racking up &#163;100,000 of debt on the company credit card due to online poker.