Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tcl array problems

Status
Not open for further replies.

merang

Programmer
Aug 27, 2014
17
MY
Hi all..i have a problem regarding the use of array in tcl programming..i have a file like below:

**user johny
subuser abu

basikal runner 2008 new
kereta honda 2005 second
motor yamaha 2010 new

end abu

** edwind
subuser ahmad

book himym 2007 second
house ara 2013 new
shoes nike 2014 new
sport chelsea 2006 legend

end ahmad


i want to open this file and enter input, then the program will count how many element does the user have.
for example "enter user name : abu

output:

abu is under johny and has 3 items which are <type> <brand> <year> <status>

the <type> <brand> <year> <status> will be display for each items belongs to abu.

for your information, the "**" is the comment for the file that i want to open (johny is a comment)

how to use an array to get all the data from the file using tcl?
thanks in advance




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top