09-09-2013 05:18 AM
Hello I want to increment the [step002] automatically in the .ini file. If the steps are copied and pasted more times in already existing file, where by doing so the step numbers are doubled. For example if there exists [Step002] followed by content of it and then [Step001] and followed by contet of it and [Step002] followed by content of it. And if a person copies [Step002] with its content 80 times or n number of times then the last one should be automatically incremented to new number as [Step003] and [Step004] [Step005]. And then I want to arrange the content under each step. In my file I have a " Group_Start = Step001" and " Group_Name = OQ_004 set high port" as contents in each step. I want to arrange the group name.
What I want is, if in the newly copied [Step002] which would have already been incremented to [Step004], it would contain Group_Name = OQ_004 set high port which I have highlighted in italics, if this already exists some where in the file, then its corresponding Group_Start = Step001 which I have highlighted in italics should be given to the newly copied and incremented [Step004]. And in case the Group_Name = OQ_004 set high port which I have highlighted in italics does not match any where then its corresponding Group_Start will be as Group_Start = Step004. That means since the group name is new and it does not exist already in the file, the Group_Start should take its step number [Step004] which her I have highlighted in italics, as its Group_Start = Step004. Here with I attach my file and I also attach my steps which I had tried. It would be nice if solution is given or further step ideas from my steps to complete the task is given.
Thank you.
John
09-09-2013 09:29 AM
Your attached vi does not make any sense and the sub vi is missing. It is also hard to understand what your problem is from your post. You want to make some programmatic changes to an ini-file. Where do you get stuck? I get the feeling you are stumbling on the basic concepts?
Have you considered using the Programming -> File I/O -> Config file VIs which might be some help along the way?
09-11-2013 01:42 AM - edited 09-11-2013 01:46 AM
Hello, Thank you for your reply. May be I break it into steps. Now where I am struck is that if there are say random numbers some repeated ones
example 001, 002, 002, 002, 004, 007, 006 etc.. I would like get sorted in ascending order and also the reapeated numbers should be in the running order. That means 001, 002, 003, 004, 005, 006 etc.. There should not be repeated numbers.if reapeatd then the repeated one should have to be incremented from the previous one. If this has been solved then I can explain the other part and shall aslo goahead. I had already tried one method but the loop seems to be not exactly matching. There are some numbers which come extra. You can use the same config file which I had sent earlier. Just copy and paste the steps below or inbetween and use it for testing. Thank you
09-11-2013 02:01 AM
Use the ini-read functions and it'll be really easy and pretty code. Check and modify attached VI.
/Y