Hi there,
Glad to find this group! I am new to CLIPS, although I have went through the basic programming guide but I am not sure about the complexity of my idea if I use CLIPS.
Could anyone tell me which of the following plan would be easier to do in relatively short time? Thanks in advance!
The main idea:
I want to sort a 100x2 table (from stored external files) according to the contents (numbers) in 1st column, say, from the largest to the smallest. And then I will need the corresponding contents (characters) in the 2nd column and print them out following the sorted order.
Example:
Here are the contents in original files:
3, aa
5, bb
2, cc
8, dd
After sorting the 1st column:
8, dd
5, bb
3, aa
2, cc
And I need to print out in order:
dd
bb
aa
cc
That's all I need.
There are two plans:
1) I would use CLIPS itself to realize by using "sort" function. But the difficulty here is that I don't know how to sort a multi-dimensional data (while preserving the 2nd column) in CLIPS. It seems that CLIPS doesn't have "array" data type; so I don't know if there is any way to do that.
2) I would use C++ to read the external files and sort the result; then pass the result to CLIPS and let it print out the results one by one. The difficulty here lies in the interface between C++ and CLIPS. Could you give me any advice? An example code is highly appreciated.
Thank you very much and I am looking forward the answers.
-Cindy