1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

looping and call in text files

Discussion in 'C' started by wasiy102, Jul 14, 2013.

  1. wasiy102

    wasiy102 New Member

    Jul 14, 2013
    Likes Received:
    Trophy Points:
    Hi ,

    I am trying to create a loop to call in the entries from the text file named Set.
    The entries of Set.txtare :
    1 2 3
    2 4 5
    and so on .. (64 such combinations)[/code]

    it basically means the first combination for testing is 1 2 3 and next has to be 2 4 5 and so i have 64 such entries defined in set

    my test files are located in D://data// and are named tst_data1 to tst_data64.

    i created a loop for test set but its incorrect
    // loop for test samples
    char basefilename[] = "D://data//"; 
    char , testFilen[160], numiChar[10];
    for (int i=1; i<=64; i++) {
    strcpy(basefilenme, "D://data//");	
    strcat(testfilename, Set[]);
    if (testfilenme[i]=='_' && testfilenme[i+1]=='\0'){
    strcat(testfilename, numiChar);
    strcat(testfilename, "_");
    strcat(testfilename, ".txt");
    please let me know how can i call the Set .txt and how to define it.

    thanks in advance!
    Last edited by a moderator: Jul 14, 2013

Share This Page