Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: file_to_map

  1. #11
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    752

    Default

    map_to_file saves a map to a file not a string. Create a map such as...int[string] mymap. Fill the map with the strings you want in the file. Then use map_to_file(mymap,"file.txt") to save your map of strings to the file.
    Last edited by AlbinoRhino; 04-14-2018 at 04:01 PM.

  2. #12
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    311

    Default

    map_to_file saves a map to a file not a string. Create a map such as...int[string] mymap. Fill the map with the strings you want in the file. Then use map_to_file(mymap,"file.txt") to save your map of strings to the file.
    Originally Posted by AlbinoRhino View Post
    So, I need to turn the matcher, or (M) into a string?

  3. #13
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    752

    Default

    Code:
         matcher m = create_matcher("was ([^<]+)", raidlog);
        string[int] mymap;  <--- define a map to store the string(s)
    
        
       /*
         " if (find(m)) " will find the first match to the pattern defined with create_matcher()
         " while (find(m)) " will keep looking through the 'raidlog' text and find all matches to the pattern.
    
    
       */
    
    
       if (find(m))
       {
            print ("test");
            print(m);
            print(group(m,1));
            mymap[count(mymap)] = group(m,1);  <--- put it in a map -- once with if(find(m)) -OR- repeatedly with while(find(m))
       }
    
       map_to_file(mymap,"myfile.txt");  <--- after done building map, save map to a file
    Now, how can I put that into a map?
    Originally Posted by Pazleysox View Post
    Last edited by AlbinoRhino; 04-15-2018 at 01:38 AM.

  4. #14
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    311

    Default

    That's fantastic! Thanks a ton!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •