Reading dilimited input from a text file with tokenizer

i am trying to read in a text file with the following structure: 2 integers on each line with comma as the delimitor.
i am using the BufferedReader stream and Tokenizer to detect ",".
try {
BufferedReader in = new BufferedReader(new FileReader(filename));
//read in the data file
while ((s = in.readLine())!= null) {
int i = 0;
for (i = 0; i < 100; i++) {
t = new StringTokenizer(s,",");
A1 = Integer.parseInt(t.nextToken());
catch (IOException e) {System.err.println(e);}
When i print out A1[i], it only reads the last line of the text file. Please tell me what's wrong.
Also i'd really like A1[i] to store the integer before the comma and another array A2[i] to store the integer after the comma. Please help.
Thanks.
p.s. A1 and A2 are arrays...when i previewd message in Netscape 7 it left out the brackets and the index....

What is the for i loop for? If it is to read the next line from the file, then the while loop has taken care of it. Other than this there should be no problem with the rest of the code.
Just add another line to store the next token into A2.

Similar Messages

  • How to read every line from a text file???

    How can i read every line from my text file ("eka.txt")
    now it only reads the first line and prints it out.
    What is wrong with this?
    import java.io.*;
    import java.util.*;
    class Testi{
         public static void main(String []args)throws IOException {
         BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
    File inputFile = new File ("eka.txt");
    FileReader fis =new FileReader(inputFile);
    BufferedReader bis = new BufferedReader(fis);
    String test=bis.readLine();
    String tmp= "";
    while((bis.readLine().trim() != null)) {
    int spacefound=0;
    int l=test.indexOf(" ");
         for(int i=0;i<test.length();i++){
         char c=test.charAt(i);
         if(c!=' ') tmp+=""+c;
         if(c==' ' && (spacefound<1) && !(tmp.equals(""))){
         tmp+=""+c;
         spacefound++;
         if(tmp.length()==l) {
         System.out.println(tmp);
         tmp="";
         spacefound=0;
         if(tmp.length()<l){
         for(int i=0;i<=(l-tmp.length());i++)
         tmp+=""+' ';
         System.out.println(tmp);

    Try this code, Hope it servers your purpose.
    import java.io.*;
    import java.util.*;
    class Testi {
         public static void main(String []args)throws IOException {
              BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
              File inputFile = new File ("Eka.txt");
              FileReader fis =new FileReader(inputFile);
              BufferedReader bis = new BufferedReader(fis);
              String test=bis.readLine();
              while(test != null) {
                   StringTokenizer st = new StringTokenizer(test," ");
                   while(st.hasMoreTokens())
                        System.out.println(st.nextToken());
                   test = bis.readLine();
    }Sudha

  • How to read some lines from a text file using java.

    hi,
    i m new to java and i want to read some lines from a text file based on some string occurrence in the file. This file to be read in steps.
    we only want to read the file upto the first Occurrence of "TEXT" string.
    How to do it ,,,
    Kinldy give the code
    Regards,
    Sagar
    this is the text file
    dfgjdjj
    sfjhjkd
    ghjkdg
    hjkdgh TEXT
    ikeyt
    ujt
    jk
    tyk TEXT
    rukl
    r

    Hendawy wrote:
    Since the word "TEXT" is formed of 4 letters, you would read the text file 4 bytes by four bytes. Wrong on two counts. First, the file may not be encoded 1 byte per character. It could be utf-16 in which case it would be two byte per character. Second, even if it were 1 byte per character, the string "Text" may not start on a 4 byte boundary.
    Consider a FileInputStream object "fis" that points to your text file. use fis.read(byte[] array, int offset, int len) to read every four bytes. Convert the "TEXT" String into a byte array "TEXT".getBytes(), and yous the Arrays class to compare the equality of the read bytes with your "TEXT".getBytes()Wrong since it relies on my second point and will fail when fis.read(byte[] array, int offset, int len) does not read 4 bytes (as is no guaranteed to). Check the Javadoc. Also, the file may not be encoded with the default character encoding.
    The problem is easily solved by reading a line at a time using a BufferedReader wrapping an InputStreamReader wrapping a FileInputStream and specifying the correct character encoding.
    Edited by: sabre150 on Apr 29, 2009 2:13 PM

  • How do i read complete line from a text file in j2me?????

    how do i read complete line from a text file in j2me????? I wanna read file line by line not char by char..Even i tried with readUTF of datainputstream to read word by word but i got UTFDataFormatException.. Please solve my problem.. Thanks in advance..

    That is not my problem . i already read it char by char.. i am getting complete line..But this process is taking to much time..So thats why i directly wanna read complete line or word to save time..

  • Reading one line from a text file into an array

    i want to read one line from a text file into an array, and then the next line into a different array. both arays are type string...i have this:
    public static void readAndProcessData(FileInputStream stream){
         InputStreamReader iStrReader = new InputStreamReader (stream);
         BufferedReader reader = new BufferedReader (iStrReader);
         String line = "";          
         try{
         int i = 0;
              while (line != null){                 
                   names[i] = reader.readLine();
                   score[i] = reader.readLine();
                   line = reader.readLine();
                   i++;                
              }catch (IOException e){
              System.out.println("Error in file access");
    this section calls it:
    try{                         
         FileInputStream stream = new FileInputStream("ISU.txt");
              HighScore.readAndProcessData(stream);
              stream.close();
              names = HighScore.getNames();
              scores = HighScore.getScores();
         }catch(IOException e){
              System.out.println("Error in accessing file." + e.toString());
    it gives me an array index out of bounds error

    oh wait I see it when I looked at the original quote.
    They array you made called names or the other one is prob too small for the amount of names that you have in the file. Hence as I increases it eventually goes out of bounds of the array so you should probably resize the array if that happens.

  • Reading Each String From a text File

    Hello everyone...,
    I've a doubt in File...cos am not aware of File.....Could anyone
    plz tell me how do i read each String from a text file and store those Strings in each File...For example if a file contains "Java Tchnology forums, File handling in Java"...
    The output should be like this... Each file should contains each String....i.e..., Java-File1,Technology-File2...and so on....Plz anyone help me

    The Java� Tutorials > Essential Classes: Basic I/O

  • Reading signed interger from a text file:

    Is this possible with some construct in java? Attempting to read a signed number using .readInt() throws an exception before the first token is a malformed int. i,e, the sign + or -.
    I would like to read a signed integer from a text file but I am clueless.
    Any help is appreciated.

    It can be a bit of a dilemma for lexical analysers. Say you read "a + 12" then you'd generally want to process that as three separate lexemes. The monadic form of plus is less common than the monadic minus.
    A quick test shows that "+12" and "+ 12" are both rejected by Integer.parseInt() (which surprised me).
    I'd suggest if you want to read positive numbers then first analyse your input using a regular expression, for example "\\s*([-+]?)\\s*(\\d+)" followed by
    (matcher.match(1).equals("-") ? -1 : 1) * Integer.parseInt(matcher.match(2));Edited by: malcolmmc on May 24, 2010 2:10 PM

  • How to parse data from a text file with no convenient delimiters?

    I need to read data from a text file.  This file contains one line of data with the repeating pattern "time 00 ADVar2: ___ Height: ____ time 01 ADVar2: ___ Height: ___ ..."  I need LabView to parse out the "time" and "height" values, build an array with the values, and graph the correlation on an X&Y plot.  Does Labview have an automated way to read to the input data file and parse out the correct values, even without convenient delimiters?  Thank you.

    You actually do have a convenient delimiter: "time". Thus, you can make an array using that as the delimiter. Only caveat is that the first array element will be empty. Then you can conveniently use the Scan From String function in a for-loop. Something like this:
    Message Edited by smercurio_fc on 11-21-2008 03:13 PM
    Attachments:
    Example_VI.png ‏9 KB

  • Reading parameters lists from a text file

    Hi All,
    Using CR XI R2 with VB6  and external .rpt files - - - - -
    In a VB6 app I use VB to loop through my tables to create dynamic parameter lists (CR XI is limited to the number of parameters it can create from the table). This works well but each time the user refreshes the report the same code is run to re-create the parameter list which is redundant and slows down the report(s).
    Is it possible to manually create a series of text files - say each morning - and then read the parameter lists from the text file(s) at runtime instead of doing it on the fly each time?
    Thanks in advance!
    Peter Tyler
    Geneva - Switzerland

    I find this sentence confusing:
    Is it possible to manually create a series of text files - say each morning - and then read the parameter lists from the text file(s) at runtime instead of doing it on the fly each time?
    Typically, runtime means on the fly - I think...
    So, I'm not sure if you are trying to read a saved data report and filter that saved data so that you do not have to hit the database(?).
    Creating a text file is beyond the support of this forum, though that should be a trivial exercise. Reading a text file and passing the results to a parameter is the same thing you are doing already, so I'm not sure where the hang up would be here(?)
    Or - rather than creating a text file, why not create a temp table and query it as you do when you loop through the tables to create dynamic parameter lists(?).
    I'm pretty lost here...
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to read specific lines from a text file using external table or any other method?

    Hi,
    I have a text file with delimited data, I have to pick only odd number rows and load into a table...
    Ex:
    row1:  1,2,2,3,3,34,4,4,4,5,5,5,,,5  ( have to load only this row)
    row2:   8,9,878,78,657,575,7,5,,,7,7
    Hope this is enough..
    I am using Oracle 11.2.0 version...
    Thanks

    There are various ways to do this.  I would be inclined to use SQL*Loader.  That way you can load it from the client or the server and you can use a SQL*Loader sequence to preserve the row order in the text file.  I would load the whole row as a varray into a staging table, then use the TABLE and MOD functions to load the individual numbers from only the odd rows.  Please see the demonstration below.
    SCOTT@orcl12c> HOST TYPE text_file.csv
    1,2,2,3,3,34,4,4,4,5,5,5,,,5
    8,9,878,78,657,575,7,5,,,7,7
    101,201
    102,202
    SCOTT@orcl12c> HOST TYPE test.ctl
    LOAD DATA
    INFILE text_file.csv
    INTO TABLE staging
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
    (whole_row VARRAY TERMINATED BY '/n' (x INTEGER EXTERNAL),
    rn SEQUENCE)
    SCOTT@orcl12c> CREATE TABLE staging
      2    (rn         NUMBER,
      3     whole_row  SYS.OdciNumberList)
      4  /
    Table created.
    SCOTT@orcl12c> HOST SQLLDR scott/tiger CONTROL=test.ctl LOG=test.log
    SQL*Loader: Release 12.1.0.1.0 - Production on Tue Aug 27 13:48:37 2013
    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
    Path used:      Conventional
    Commit point reached - logical record count 4
    Table STAGING:
      4 Rows successfully loaded.
    Check the log file:
      test.log
    for more information about the load.
    SCOTT@orcl12c> CREATE TABLE a_table
      2    (rn       NUMBER,
      3     data  NUMBER)
      4  /
    Table created.
    SCOTT@orcl12c> INSERT INTO a_table (rn, data)
      2  SELECT s.rn,
      3         t.COLUMN_VALUE data
      4  FROM   staging s,
      5         TABLE (s.whole_row) t
      6  WHERE  MOD (rn, 2) != 0
      7  /
    17 rows created.
    SCOTT@orcl12c> SELECT * FROM a_table
      2  /
            RN       DATA
             1          1
             1          2
             1          2
             1          3
             1          3
             1         34
             1          4
             1          4
             1          4
             1          5
             1          5
             1          5
             1
             1
             1          5
             3        101
             3        201
    17 rows selected.

  • Reading in integers from a text file

    Hi, I am going to go for the 'reading in from a text file' action as I haven't done this before. So I have been looking at all the examples and am trying the one out below :) My question is that though the structure seems pretty straightforward, what is the action of the 'token' and why doesn't java recognise it as it is used in many different examples that I have seen?
    public static int[] getIntegersFromFile(String fileName) throws IOException {
                   StringWriter writer = new StringWriter();
                   BufferedReader reader = new BufferedReader(new FileReader(fileName));
                   List<Integer> list = new ArrayList<Integer>();
                   for (String line = reader.readLine(); line != null; line = reader.readLine()) {
                   writer.write(line + " ");
                   StringTokenizer tokens = new StringTokenizer(writertoString());
                   while (tokens.hasMoreTokens()) {
                        String str = tokens.nextToken();
                        try {
                             list.add(new Integer(str));
                             } catch (NumberFormatException e) {
                                  System.out.println("Error '" + str + "' is not an integer.");
                   int[] array = new int[list.size()];
                        for( int i = 0; i < array.length; i++){
                        array[i] = list.get(i);
                   return array;
         }

    Hey, first of all, a piece of advice, try formatting your codes you make easier
    to understand for the people who help you. You can check out the
    formatting tips
    Now, A think that could help you a lot, is the next link, seek out the
    documentation for the StringTokenizer class
    http://java.sun.com/j2se/1.5.0/docs/api/
    Here your code formated and later my interpretation of your question.
    public static int[] getIntegersFromFile(String fileName) throws IOException {
       StringWriter writer = new StringWriter();
       BufferedReader reader = new BufferedReader(new FileReader(fileName));
       List<Integer> list = new ArrayList<Integer>();
       for (String line = reader.readLine(); line != null; line = reader.readLine()) {
          writer.write(line + " ");
       StringTokenizer tokens = new StringTokenizer(writertoString());
       while (tokens.hasMoreTokens()) {
          String str = tokens.nextToken();
          try {
             list.add(new Integer(str));
          } catch (NumberFormatException e) {
             System.out.println("Error '" + str + "' is not an integer.");
       int[] array = new int[list.size()];
       for( int i = 0; i < array.length; i++){
          array = list.get(i);
       return array;
    }StringTokenizer separates the string contained by the space character, and
    each piece of the separated string is stored into the token.
    Further on, could you extend your question about "why doesn't Java
    recognize what?" please, because I don't know if you have a problem
    iterating or is just that it doesn't compile or what.
    Expecting your answer, to complete mine, cya around.
    -Best Regards.

  • How to read some records from a text file into java(not all records)

    hello,
    how to read text files into java. i need only few records from the text file not all records at a time.
    If any one knows plz reply me
    my id is [email protected]

    this snipet reads a text file line by line from line 1 to 3
    try {
                  FileReader fr = new FileReader(directory);
                  BufferedReader br = new BufferedReader(fr);
                  int counter = 0;
                  while ((dbconn = br.readLine()) != null) {
                      switch(counter){
                          case 0:
                            status = dbconn;
                          break;
                          case 1:
                            userName = dbconn;
                          break;
                          case 2:
                            apword = dbconn;
                          break;
                      counter++;
                  br.close();
        }catch(IOException e){
        }

  • How to save input from a text file in to array

    I got this assignment, and almost have no clue, and my teacher doesn't even teaches us anything
    This is what i am suppose to do
    5. The program must store the following data about each student in this Talent Show:
    * The student's name (store as a String)
    * The student's average time score [only for the events they competed in] (store as a Double)
    Note: Some of the data comes directly from the text file, and some of the data must be calculated from the data that is read from the file.
    6. The program must search through all of the student's scores to find the student who has the minumum average time of all students.
    7. You must calculate how many events each student played. Zero values are not counted.
    8. You must then generate a report on the screen that prints out
    * the total number of students in the competition,
    * the winning student's ...
    o name
    o times
    o average time (rounded to one decimal places)
    Sample output
    btw this is the data file
    Bart Simpson
    7.5
    12.3
    7.8
    19.2
    9.9
    5.3
    8.5
    11.8
    2.2
    4.6
    Stewie Griffin
    9.5
    29.7
    7.8
    22.5
    9.9
    12.6
    8.5
    0
    8.2
    0
    Pinky
    2.5
    0
    1.8
    0
    3.9
    0
    6.5
    0
    5.2
    12.1
    Rocky N Bullwinkle
    10.0
    22.2
    9.5
    17.5
    9.9
    1.5
    8.7
    23.7
    9.2
    11.0
    Angelica Pickles
    5.5
    11.1
    6.8
    12.2
    7.9
    13.3
    8.1
    5.1
    7.2
    7.9
    Pink Panther
    8.5
    5.5
    8.8
    6.6
    8.9
    7.7
    9.9
    8.8
    2.2
    9.9
    Josie
    9.5
    0
    8.8
    12.2
    9.9
    0
    8.5
    0
    9.2
    5.3
    Rogue
    8.5
    1.1
    7.8
    2.2
    7.9
    3.3
    7.5
    4.4
    8.2
    5.5
    Usagi Tsukino
    8.5
    15.5
    8.8
    30.1
    9.9
    19.7
    9.5
    11.0
    8.2
    8.6
    Yosemite Sam
    0
    15.2
    0
    29.5
    3.9
    0
    0
    16.0
    0
    7.7
    My code so far
    import java.io.*;
    public class test
        public static void main (String [] args)
            FileInputStream File1;
            DataInputStream In;
            String fileInput = "";
            try
               File1 = new FileInputStream ("data.txt");
                In = new DataInputStream (File1);
                while (In.available () > 0)
                    fileInput = In.readLine ();
                    System.out.println (fileInput);
                In.close ();
            catch (FileNotFoundException e)
                System.out.println ("Error - this file does not exist");
            catch (IOException e)
                System.out.println ("error=" + e.toString ());
    }My question, how do i save the data in to an array, and how do i seperatly save names in to different array, and their scores in to different arrays
    bte he said you can use scanner class
    Thanks
    Edited by: supahsain08 on Mar 26, 2008 2:55 PM

    supahsain08 wrote:
    Well, you are not in my class and you don't even know my teacher
    who are you to judge meHe is jaded by our experiences here. 99% of posters who complain that the teacher doesn't teach have adequate (note that I didn't say good) teachers, but it's the student who is failing to take responsibility for his own education. It is after all your responsibility and complaining won't help you any.
    Good luck.

  • At end of tether!  Reading in variables from a text file

    Hi all
    My stress factor has gone through the roof because I am trying to read in from a text file (you may have seen some earlir questions about ArrayLists) it's just not working!
    The code is below. The result is that it's reading in all of the car data, none of the motorbike and only the first line for the services. It's odd and it's driving me insane!
    Here's an example of the data it's reading. There are about 7-10 sets of data per type
    <car><reg>AB04CDE</reg><make>Ford</make><model>Fiesta</model><colour>blue</colour><passenger_no>4</passenger_no></car>
    <service><service_no>13570</service_no><reg>J605PLE</reg><date>15:07:2006</date><miles>20000</miles><part_replaced>brake_pads</part_replaced><part_replaced>front_tyres</part_replaced></service>
    <motorbike><reg>TT05EKJ</reg><make>Triumph</make><model>Speedmaster</model><colour>black</colour><load>20.50</load></motorbike>
    Here's the code
    while (moreToRead) {
            String line;
            try {
              line = fileReader.getNextStructure();
    // collect the data from the file
              if (line.indexOf("<car>")> -1){
                // Select/Extract the registration element
                int nStart = line.indexOf("<reg>");
                int nEnd = line.indexOf("</reg>");
                String reg = line.substring(nStart+5,nEnd);
                // Select/Extract the make element
                nStart = line.indexOf("<make>");
                nEnd = line.indexOf("</make>");
                String make = line.substring(nStart+6,nEnd);
                // Select/Extract the model element
                nStart = line.indexOf("<model>");
                nEnd = line.indexOf("</model>");
                String model = line.substring(nStart+7,nEnd);
                // Select/Extract the colour element
                nStart = line.indexOf("<colour>");
                nEnd = line.indexOf("</colour>");
                String colour = line.substring(nStart+8,nEnd);
                // Select/Extract the passenger_no element
                nStart = line.indexOf("<passenger_no>");
                nEnd = line.indexOf("</passenger_no>");
                String passenger_no = line.substring(nStart+14,nEnd);
                //convert string to int
                int passengerInt = Integer.parseInt(passenger_no);
                // declare new object car and assign the variables then add it to the array.
                Car c = new Car (reg, make, model, colour, passengerInt);
                carList.add(c);
      } else if (line.indexOf("<bike>")> -1) {
             // Select/Extract the registration element
             int nStart = line.indexOf("<reg>");
             int nEnd = line.indexOf("</reg>");
             String reg = line.substring(nStart+5,nEnd);
             // Select/Extract the make element
             nStart = line.indexOf("<make>");
             nEnd = line.indexOf("</make>");
             String make = line.substring(nStart+6,nEnd);
             // Select/Extract the model element
             nStart = line.indexOf("<model>");
             nEnd = line.indexOf("</model>");
             String model = line.substring(nStart+7,nEnd);
             // Select/Extract the colour element
             nStart = line.indexOf("<colour>");
             nEnd = line.indexOf("</colour>");
             String colour = line.substring(nStart+8,nEnd);
             // Select/Extract the load element
             nStart = line.indexOf("<load>");
             nEnd = line.indexOf("</load>");
             String load = line.substring(nStart+6,nEnd);
             //convert load string to double
             double bikeLoad = Double.parseDouble(load);
             // declare new object motorbike and assign the variables then add it to the array.
             Motorbike m = new Motorbike (reg, make, model, colour, bikeLoad);
             bikeList.add(m);
      } else  {
        // Select/Extract the service_number element
        int nStart = line.indexOf("<service_no>");
        int nEnd = line.indexOf("</service_no>");
        String service_no = line.substring(nStart+12,nEnd);
        console.println("service = " + service_no);
        nStart = line.indexOf("<reg>");
        nEnd = line.indexOf("</reg>");
        String reg = line.substring(nStart+5,nEnd);
        console.println("service = " + reg);
        nStart = line.indexOf("<date>");
        nEnd = line.indexOf("</date>");
        String date = line.substring(nStart+6,nEnd);
        console.println("service = " + date);
        nStart = line.indexOf("<miles>");
        nEnd = line.indexOf("</miles>");
        String miles = line.substring(nStart+7,nEnd);
        console.println("service = " + miles);
        nStart = line.indexOf("<part_replaced>");
        nEnd = line.indexOf("</part_replaced>");
        String part_replaced = line.substring(nStart+15,nEnd);
        console.println("service = " + part_replaced);
        //convert string to int
        int dateOfService = Integer.parseInt(date);
        //convert string to double
        double milesAtService = Double.parseDouble(miles);
        //convert service no to unique int
        int serviceNo = Integer.parseInt(service_no);
        // declare new object service and assign the variables then add it to the array.
        Service s = new Service (reg, part_replaced, serviceNo, dateOfService, milesAtService);
          serviceList.add(s);
          catch (Exception e) {
            // Run out of data
            moreToRead = false;
    } If anyone can spy anything that could be causing this I love your advice. I simply can't see it.
    Jo

    hi jos,
    we have been asked not to use a parser for this assignment. evil
    tutor i think! lolYour example seems to imply that all the <tag> ... </tag> pairs have
    to occur on a single line; if that is so, you can do some cheap
    programming like this:String getText(String line, String tag) {
       int start= line.indexOf("<"+tag+">");
       int end= line.indexOf("</"+tag+">", start);
       if (start < 0 || end < 0) return null; // no <tag> ... </tag> pair found
       // return the text in between the <tag> ... </tag> tags
       return line.substring(start+tag.length()+2, end);
    }kind regards,
    Jos

  • Read specified line from a text file

    Hi,
    I am trying to read a specific line from a text file. I don't want to read all of it but just this specific line... say line number 2. Is there a method built-in in java or should I code this myself?
    Thanks and regards,
    Krt_Malta

    Krt_malta wrote:
    I am trying to read a specific line from a text file. I don't want to read all of it but just this specific line... say line number 2. Is there a method built-in in java or should I code this myself?Is there anything in your use case that precludes using the offset of the start of the line rather than the line number?

Maybe you are looking for

  • Can I install mountain lion on my Imac

    I have a late model 2006 Imac with 4gb of RAM, I would like to install mountain lion, is this possible.

  • How do you change the name of a document in pages on an iPod touch?

    I am on my iPod touch and I want to name my document in Pages. How do I do it?? I know you can, but how??

  • Apple security, is it working?

    As one of the very many people to have their Apple computer infected with "Mac defender..etc.." malware in the last month I have to ask can we trust Apples claims that their machines are proof to virus attack and that 3rd party security software is u

  • AD provisioning is not creating accounts

    Hi All, I am trying to provisiong AD resource using a simple Role. When I assign the Role directly to user in admin UI its working fine. The steps I have taken: 1. get view 2. assing the role 3. reprovision call But in the workflow, its not, any clue

  • Quantity proposal in batch selection

    In batch search strategies you can select a quantity proposal routine to be used to allocagtge qtys to the proposed batches in a specific manner. I'm trying to locate where you add/change/modify these routines.  The help file indicates these are main