Emm lets say the price is not added at the last but instead add in any place..so I need to change the example that u give in previous post because it assign <set year [lindex $line_list 2]>...I need to modify them like <set price [lindex $line_list 2]> so that I can print out the output of price...
Yes, because the loop is hardcode, it is fixed for that particular elements only..it is hard to change the elements in the loop everytime when there are changes in the input file.
To make the code more robust, can u give me an example of the another method that you mentioned before?
Hi,
i have refer to your code and tried my own code, and it works well. i see that this code is the HARDCODE. if i want it to become a SOFTCODE, as an example if another input file has other added elements beside the previous one (Device Type Year Status Company [highlight...
yes, it answers my question sir.. i have modified the code with my own code to fulfill the purpose of my question.
for the header i use another command to set the header. is it possible to use the input file as the header?
Device <blank space> Type <blank space> Year <blank space> Status...
set line_list [regexp -all -inline {\S+} $line], is this the code to detect the duplicate? Need to modify it so that can meet the purpose of this program?
Or I need to come out with a new condition? Some example sir?
Thanks in advance. .
OIC..sir,which part of the code that detect the same path and device, remove the duplicate and take only the last occurence? FYI the code should remove the duplicate if and only if the path and device are the same..
From the above example..we have 3 samsung right:
electro/trend/latest/phone...
Tq for such a good explaination sir..one question, if some of the path is electro/trend/latest/phone and other path got electro/trend/latest/tech/hardware/phone, is the code still can be use sir? To get the device is phone only..
Thanks in advance :)
Hi all, i have a question to ask..i want to read an input file and write it to a new output file,
the content of my input file as follows (not limited to these item only, can have up to hundreds items):
Device <blank space> Type <blank space> Year <blank space> Status <blank space>...
Hi, i am new to tcl programming. i have one question about array. i store data from .txt files in an array call country.
[highlight #EF2929]array set country {$food $place}[/highlight]
where $food and $place is the data that i get from the .txt file. i want to display them so i do:
foreach...
hi feherka,
thanks for such a good explanation. the expected output is as you wrote but the etc4 should be under etc3 and not under etc1.should be like this:
master # tclsh netlist.tcl
please enter the library name : etc1
etc1 etc2 3
if run again the program:
please enter the library name ...
Hi feherka,
The given code is not working when i try to do a long list of file. Maybe because of the string range that you have specified in your code. Is it possible to do without array as the netlist is a complex data structure. It consist of many library name, for each library name got cell...
For your info, in the netlist there are more than 30 different libraryname and cellname and also more than hundreds of instance. Can I use the code above for the netlist?
Hi feherka..
Tq for your concern..actually my file is a netlist. The input file that I wrote is just an example on how the structure and how the netlist looks like..
The file looks like this
**Library name : etc1
**cellname : etc2
.subckt etc2
(List of instance)
.end etc2
**Library name ...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.