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
**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