clc;
clear all;

file_name = input('Enter file name:');
total_entries = input('Enter total entries:');
max_seq_length = input('Enter max sequence length:');
num_items = input('Enter number of items:');

%Get each entry
fid = fopen(file_name,'w');
for count=1:total_entries
    sequence_length = ceil(rand * max_seq_length);

    sequence = zeros([1 sequence_length]);
    seq_str = '';
    for count3=1:sequence_length
        found = 1;
        while(found == 1)
            found = 0;
            item = ceil(rand * num_items);
            for count4=1:length(sequence)
                if(sequence(count4) == item)
                    found = 1;
                end
            end
        end
        sequence(count3) = item;
        seq_str = [seq_str sprintf('%d ',item)];
    end

    %Write this to the file
    fprintf(fid,'%s\n',seq_str);
end
fclose(fid);