Dynamic read file based off inbound header

This is all done with BPEL
1. We want to get a file from a server VIA FTP adapter. So we setup an ftp adpter to get L11*.TXT (Any files beginning with L11)
1A.So we create this FTP adapter and then we create a receive activity to get this file from the FTP adapter.
***********Now mind you we have created our variables that come into play later such as inbound FTP adapter header & outbound FTp adapter header*************
2. Below this receive we create An assign activity with a copy operation.
Now for this assign we simply create a copy operation that includes our headers. Specifically we choose why down in the heirachy of Inbound and outbound ftp adter headers the :filename option
2A. So what we have is an assign with a copy operation from in bound ftp adapter to outbound ftp adapter
3. Then we have our fist invoke. ********Now mind you ************ BPEL cannot overwrite a file and the customer wants the file name the same as was picked up. Meaning no %seq # or %date or date stamp whatever you perfer.
So we do this first invoke and attach it to another FTP adpter that gets Sync file . Now this second ftp adpter will use the filename of the originally picked up file to go "pick up" and delete it from destination. We kinda trick the program if you will. So this ensures we dont delete a file that has a replacment behind it. Also ensures no overwriting or %seq # is needed.
On this invoke we have under adapters section Input header variable: OutboundFtpHeader (Mind you we did a copy on the first assign from inbound to outbound header varibale.)
We do nothing with any data collected between the first invoke and syncgetftpadapter. We just make it think it is going out picking up a file. And in this perspective we can choose delete after the pick up and inevitably it will "pick up file" At same time now that file is deleted on destination, thus making overwriting and %seq # not needed.
4.
We create another assign below our invoke
this has our inbound header copied to outbound once again
Specifically :filename
5.
This will lead to another invoke which leads to another ftp adapter that drops off the orginal file that was picked up now it can drop it off with that same filename as picked up and no overwriting neccassary because the file was deleted off the destination already.
Well when you make a Put ftp adapter you must specify a filname and we just want a dummy filename well we thiunk that is a dummy, because we are trying to use the orginal file name as the one to make it when it drops off whatever filename it picked up .
for example we choose test.txt thinking inbound variable will overwrite it
but the right file gets transferred but wrong file name attached.
my guess is that the putftpadapter overwrites any "filename specified" Or inbound header file name. lol you need to have a file name on the put you need one no way around it.
So i guess what im trying to do is pick up files then have the program dynamically be able to drop off that filename and contents to the destination.
Icould create three seperate programs for our three L11 files but that is alot of overhead?
Message was edited by:
vande

Hmmm maybe someone can point me to a site that explains how to put catches in. I mean i know how to put them in but i want to make sure im doing this correctly. Also maybe debatching, I have heard of this but i want to understand how exactly it works and how to implment this.
Ok and one more thing ............ I have a 3 files as noted above that are suppose to move. Disregard my problem with send three and all that for a moment, Now I have stated above that we have a little trick included in this where we put a get on the source to "get" the files off the source cause for some reason it wont overwrite the file. Well on was doing some testing on my box. I got an exact replica of the files that we are doing this project for and i setup a test bpel project on my machine and deployed to our test env. Now I was deploying to our test env before also but the source server was a corporate server up in Canada. Now when i did this it overwrote the file :( so my next guess was hmmm maybe the source server FTP is not setup for our username to be able to overwrite the files???
I have a simple local FTP server and was looking at the setup, and my question is. There is an option(s) to pick for new user setups
delete
write
read
ammend
Would ammend give the right to overwrite ?
Not 100% sure the source is running the same ftp application as I am locally but it will overwrite a file
One more thing sorry lol
To try my catches out i would have to somehow make the file error in the middle os the process?
I was thinkin of that yesterday I'm like well i put the catch in but how do i know if it will truely work
Message was edited by:
vande

Similar Messages

  • Dynamically Reading Files From Application Server

    Hi Experts,
    Presently I have to write a program which reads files from the application server dynamically. This program will be scheduled in the background with the frequency of half an hour.
    I am Using the function module
    CALL FUNCTION 'SUBST_GET_FILE_LIST'
    EXPORTING
    DIRNAME = '/usr/sap/xxx/xxx/'
    FILENM = 'DATASET'
    PATTERN = '.txt'
    TABLES
    FILE_LIST = IT_FILELIST
    I am facing problem in specifying the parameter FILENM in the function module,
    As I have to read many files from the apps server. How to assign the parameter of function module so it can take the many files generated in the apps server.
    Thanks in Advance,
    Regards,
    Irfan Hussain

    Hi,
    Instead of the above FM, you can use the following code :
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR po_ifile.
    PERFORM get_current_directory  USING 'PO_IFILE'   po_ifile
                                              rov-home_dir rov-curr_dir.
        PERFORM get_filename-of-server TABLES itab_filename
                                           USING  rov-curr_dir rov-gen_name.
        PERFORM help_values_get_with_table_ext TABLES itab_filename
                                           USING  rov-curr_dir
                                                       po_ifile.
    *&      Form  get_current_directory
          text
         -->P_0023   text
         -->P_PO_IFILE  text
         -->P_ROV_HOME_DIR  text
         -->P_ROV_CURR_DI  text
         -->P_CALL  text
         -->P_FUNCTION  text
         -->P_0029   text
         -->P_IMPORTING  text
         -->P_FILE_NAME  text
         -->P_=  text
         -->P_PO_IFILE  text
      FORM get_current_directory  USING _fieldname
                                        _filename
                                        homedir
                                        currdir.
        IF _fieldname <> space.
          PERFORM dunp_value_read USING _fieldname _filename.
        ENDIF.
        IF _filename = space.
          currdir = homedir.
        ELSE.
          rov-work_dir = _filename.
          rov-fdpos = STRLEN( rov-work_dir ).
          DO.
            IF rov-fdpos = 0.
              EXIT.
            ENDIF.
            rov-fdpos = rov-fdpos - 1.
            ASSIGN rov-work_dir+rov-fdpos(1) TO <rov_p>.
            IF <rov_p> = rov-delchar.
              <rov_p> = space.
              EXIT.
            ELSE.
              <rov_p> = space.
            ENDIF.
          ENDDO.
          currdir = rov-work_dir.
        ENDIF.
      ENDFORM.                    " get_current_directory
    *&      Form  get_filename-of-server
          text
         -->P_ITAB_FILENAME  text
         -->P_ROV_CURR_DIR  text
         -->P_ROV_GEN_NAME  text
      FORM get_filename-of-server TABLES nametab STRUCTURE itabfilename
                                  USING  _dirname _genname.
        CALL 'C_DIR_READ_FINISH'             " just to be sure
                               ID 'ERRNO'  FIELD rov-errno
                               ID 'ERRMSG' FIELD rov-errmsg.
        CALL 'C_DIR_READ_START' ID 'DIR'    FIELD _dirname
                                ID 'FILE'   FIELD _genname
                                ID 'ERRNO'  FIELD rov-errno
                                ID 'ERRMSG' FIELD rov-errmsg.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        REFRESH _nametab.
        DO.
          CLEAR _nametab.
          CALL 'C_DIR_READ_NEXT'  ID 'TYPE'   FIELD _nametab-type
                                  ID 'NAME'   FIELD _nametab-name
                                  ID 'LEN'    FIELD _nametab-len
                                  ID 'OWNER'  FIELD _nametab-owner
                                  ID 'MTIME'  FIELD _nametab-mtime
                                  ID 'MODE'   FIELD _nametab-mode
                                  ID 'ERRNO'  FIELD _nametab-errno
                                  ID 'ERRMSG' FIELD _nametab-errmsg.
          _nametab-dirname = _dirname.
          MOVE sy-subrc TO _nametab-subrc.
          CASE sy-subrc.
            WHEN 0.
              IF _nametab-name+0(1) = '.'.
              ELSE.
                APPEND _nametab.
              ENDIF.
            WHEN 1.
              EXIT.
            WHEN OTHERS.                     " SY-SUBRC >= 2
              EXIT.
          ENDCASE.
        ENDDO.
        CALL 'C_DIR_READ_FINISH'             " just to be sure
                               ID 'ERRNO'  FIELD rov-errno
                               ID 'ERRMSG' FIELD rov-errmsg.
      ENDFORM.                    " get_filename-of-server
    *&      Form  help_values_get_with_table_ext
          text
         -->P_ITAB_FILENAME  text
         -->P_ROV_CURR_DIR  text
         -->P_PO_IFILE  text
      FORM help_values_get_with_table_ext  TABLES _filename
                                                 STRUCTURE itab_filename
                                          USING  _currdir
                                                _selfile.
        TYPES: BEGIN OF f4typ_head_struc,
                 tabname LIKE help_info-tabname,
                 fieldname LIKE help_info-fieldname,
                 head_text LIKE shstruc-keyword,
               END OF f4typ_head_struc.
       DATA itab_fields    LIKE TABLE OF help_value        WITH HEADER LINE.
       DATA itab_selvals   LIKE TABLE OF help_vtab         WITH HEADER LINE.
       DATA itab_values    LIKE TABLE OF rlgrap-filename   WITH HEADER LINE.
       DATA itab_header    TYPE TABLE OF f4typ_head_struc  WITH HEADER LINE.
        REFRESH itab_fields.
        REFRESH itab_selvals.
        REFRESH itab_values.
        REFRESH itab_header.
        itab_fields-tabname    = 'PS0192'.
        itab_fields-fieldname  = 'BAA01'.
        itab_fields-selectflag = ' '.
        APPEND itab_fields.
        itab_fields-tabname    = 'RLGRAP'.
        itab_fields-fieldname  = 'FILENAME'.
        itab_fields-selectflag = 'X'.
        APPEND itab_fields.
        LOOP AT _filename.
          itab_values = itab_filename-type.
          APPEND itab_values.
          itab_values = itab_filename-name.
          APPEND itab_values.
        ENDLOOP.
        CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE_EXT'
           EXPORTING
            CUCOL                         = 0
            CUROW                         = 0
            DISPLAY                       = ' '
            FIELDNAME                     = ' '
            TABNAME                       = ' '
            TITLE_IN_VALUES_LIST          = ' '
            SHOW_ALL_VALUES_AT_FIRST_TIME = ' '
            USE_USER_SHRINKING            = ' '
                titel                         = _currdir
            NO_SCROLL                     = ' '
            NO_CONVERSION                 = ' '
            NO_MARKING_OF_CHECKVALUE      = ' '
           IMPORTING
                index                         = rov-index
                select_value                  = rov-selvalue
             TABLES
                  fields                        = itab_fields
                  select_values                 = itab_selvals
                  valuetab                      = itab_values
            HEADING_TABLE                 =
             EXCEPTIONS
                  field_not_in_ddic             = 1
                  more_then_one_selectfield     = 2
                  no_selectfield                = 3
                  OTHERS                        = 4.
        IF sy-subrc = 0.
          CLEAR itab_filename.
          READ TABLE itab_filename INDEX rov-index.
          IF itab_filename-type+0(3) = 'dir'.
            CONCATENATE _currdir rov-delchar rov-selvalue  rov-delchar
                                                          INTO _selfile.
          ELSE.
            CONCATENATE _currdir rov-delchar rov-selvalue INTO _selfile.
          ENDIF.
        ENDIF.
      ENDFORM.                    " help_values_get_with_table_ext
    Best regards,
    Prashant

  • Spry js for dynamically naming file based on day names..but wait theres more!

    Hi,
    I'm creating a program guide for a tv station based on xmls, so I'm wanting to creating a data set that calls a file name "sunday.xml" on a Sunday
    and feed that into the var section in the header that calls the file for that data set-see the red bit.
    example:
    var dailypg = new Spry.Data.XMLDataSet("xml/sunday.xml" , "EPG/Service/Event");
    I hope that made sense.
    The problem is that I don't know how to write js-well i wrote a script that spits out the right name, the "var filename =  etc...  bit,
    example:
    var day = new Date()
    var weekday=new Array(7);
    weekday[0]="sunday";
    weekday[1]="monday";
    weekday[2]="tuesday";
    weekday[3]="wednesday";
    weekday[4]="thursday";
    weekday[5]="friday";
    weekday[6]="saturday";
    var filename = (weekday[day.getDay()]);
    but I don't know how to feed the var "filename" into where it sets the file name for the xml. Is anyone able to point me in the right direction?
    Thanks.

    I am doing something very similar.
    var aid = 6882
    var HotelDetails2 = new Spry.Data.XMLDataSet("http://xmlfeed.****.com/index.aspx?aid=" + aid + "&rtype=3&hids=100652", "hotel_search/hotel");
    This works but have had great trouble with the wizard.  As soon as I make it dynamic then it breaks the wizard, which I would like to use.  I have tried having a line commented out which is unmodified so I can switch between the two but that really confuses it.
    Just in case you were wondering I will be getting around to getting aid from a querystring but not there yet.
    Any ideas, it can't be all that hard to do this surely and feel I must be missing something.
    Thanks,
    Steve.

  • Generate Java file based on a C++ header file

    Hi,
    I want to know if it is possible to generate a java file and JNI-based C++ file based on the header file of C++ code which I want to call.

    go to www.swig.org... swig is an exe that generates wrapper code & java JNI code. You'll need to compile & link to an so / dll yourself, but it should work

  • Dynamic File Name in a Read File

    Hello there.
    I have a need and I don't know if there is possible in Oracle BPEL 10.1.3. I need to read a different file, based on the name of it. So, I need that the file name defined in the adapter is defined dynamically in run time, based in the name of a client.
    It is possible ?
    All the files are located in the same directory, so, I don't have a problem with the location path. Only with the name of the file.
    In a read activity I don't have the Inbound Header...it is possible to do this using the OutboundHeader Type ?
    Can someone help me ?

    What you need to do is a synchronous File read. You will need to create a file adaptor but with the write functionality and then change the produced wsdl file to make it a read activity. You can then use the invoke activity to call the adaptor. Once this is done you can then create the variable as RIko has specified an pass in your file name at run time.
    The inboundheader type variable is only populated once you have read the file. So by changing a write adaptor to a read you will have both a inbound and outbound header variables.
    See link below for a more detailed description:
    http://docs.huihoo.com/oracle/docs/B14099_19/integrate.1012/b25307/adptr_file.htm
    See the section on "Synchronous File Reading Capabilities" which details exactly what you need to change.

  • Reading Files from an FTP location based on Timestamp

    Hi,
    I have a requirement of reading files from an FTP location. The files should be read in the order they were saved in the folder. Can someone tell me how to solve this?
    Thanks,
    Ravi

    Hi Arik,
    Thanks for your reply. I tried doing what u said, but it isn't working. My requirement is to List the files in the folder using FTP adapter and get the file name with the least file stamp from the FTP adapter and pass the FileName dynamically to another FTP adapter which reads the file based on the FileName. When i tested after including the property (for listing the files) you mentioned, it is giving the following error (copied from flow trace):
    <messages>
    <input>
    <Invoke_getFileListFTP_FileListing_InputVariable>
    <part name="Empty" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <empty xmlns="http://xmlns.oracle.com/pcbpel/adapter/ftp/APP_SequentialFileTransfer/PRJ_SequentialFileTransfer/WS_GetFileList_FTP"/>
    </part>
    </Invoke_getFileListFTP_FileListing_InputVariable>
    </input>
    <fault>
    <bpelFault>
    <faultType>0</faultType>
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="summary">
    <summary>Exception occured when binding was invoked. Exception occured
    during invocation of JCA binding: "JCA Binding execute of
    Reference operation 'FileListing' failed due to: Exception
    occured when binding was invoked. Exception occured during
    invocation of JCA binding: "Could not instantiate
    InteractionSpec
    oracle.tip.adapter.ftp.outbound.FTPListInteractionSpec due
    to: Cannot set JCA WSDL Property. Error while setting JCA
    WSDL Property. Property setListSorter is not defined for
    oracle.tip.adapter.ftp.outbound.FTPListInteractionSpec Please
    verify the spelling of the property. ". The invoked JCA
    adapter raised a resource exception. Please examine the above
    error message carefully to determine a resolution. ". The
    invoked JCA adapter raised a resource exception. Please
    examine the above error message carefully to determine a
    resolution.</summary>
    </part>
    <part name="detail">
    <detail>Cannot set JCA WSDL Property. Error while setting JCA WSDL
    Property. Property setListSorter is not defined for
    oracle.tip.adapter.ftp.outbound.FTPListInteractionSpec Please
    verify the spelling of the property.</detail>
    </part>
    <part name="code">
    <code>null</code>
    </part>
    </bindingFault>
    </bpelFault>
    </fault>
    <faultType>
    <message>0</message>
    </faultType>
    </messages>
    Thanks,
    Ravi
    Edited by: Ravi Santosh on Apr 24, 2012 11:02 PM

  • Dynamic file names on file based  processing

    Hi Experts
    we are doing file to file scenario using file based processing not on message based ( No Reposiitory Objects - No mapping , no interface objects ).
    we need to pickup the file name from the source directory and place it in the target directory with the same file names.
    the source file name is added with the time stamp and client number,
    Since there no mapping , we can't use the dynamic file concepts.
    Please help me with the possible solutions
    thnz for the help in advance.
    Cheers
    Faheem

    Hi Faheem,
    You will be using the dynamic config when u want to map the input file name to a field in the target message.
    As per ur requirement ASMA will do :
    try this:
    In both the sender and receiver file adapters , select Adapter Specific Identifiers and File Name
    In the receiver file adapter give some dummy value for file name and directory.
    In the runtime, the source file name and directory will be used as the target file name and directory.
    You need not use any UDF or a mapping here
    Hope it helps!!!!!!!!

  • Need to launch specific document and wave file based on the inbound Route Point

    I am having issues using CDA in terms of creating the appropriate WF to launch both a wave file and specific Word document based on the inbound DNIS.  I have UCCX 8.0(2) SU3 enhanced so I can't use HTTP.  I really need a solution today.  Thanks.

    I did script to play the file to the agent as a whisper then hang up and ring the line again to connect the caller to the agent but the customer didn't like that at all so i just created the WF to launch from the same filepath on all machines to point the the appropriate wave files based on the DNIS.  Because the customer has enhanced I'm not launching the Word docs as PDFs in a integrated browser like I'd prefer but as an external application.  Again, based on the DNIS. 

  • How to read an xml file in OSB using file protocol where reading file path is dynamic.

    HI,
    We have to read a xml file from a location and write into Db.
    Here reading file location is dynamic .
    Please suggest

    Hi
    With open dataset you can open any file on the application server. So it should be working, but maybe you are looking for:
    CALL TRANSFORMATION my_transformation
           SOURCE  XML xml_string
           RESULT  ROOT1 = field1
                   ROOT2 = field2.
    Best regards,
    Guido Koopmann

  • How to read file header/open filein binary mode

    i am using FileConnenction API to read from a file. how can i open a file in binary mode so that i can read file header. In other words i want to open a file in binary mode.

    You can always try looking at the [Header Signatures|http://www.techpathways.com/uploads/headersig.txt]. But it would probably be easier to adjust your application so it doesn't have to guess.
    ~

  • Create header file based on data in Data file

    Hi,
    For Data File: created an interface to extract data from table to data file.
    1) Now i want to create a header file which contains info like :
    Created On: #Rows Fetched:
    2) I also want to create a footer, which contains info like:
    SUM(AMOUNT) (amount is one of the columns of data file)
    How do i implement this using an interface?
    Thanks.

    Step 1. Create a Variable Header - Call the count using some thing like this SELECT COUNT(*)||CHR(10) FROM TABLE
    Step 2. Call it in OdiOutFile
    Step 3 . Call the Interface to load from table to File using [ IKM SQL to File Append  with create Header option - no ]
    Step 4. Create another Variable Footer - Call the sum in the Refreshing Tab
    Step 5. Call it in OdiOutfile with Append option Checked
    Note - Make sure you use the same File Name for all the three places.
    There are other ways too but this is simple way. Hope this helps.

  • Dynamically   reading & writing in a file

    Hi all,
    i want to find a particular string from a weblogic server log [*.log] file and write into a separate txt [output.txt] file.
    important : The weblogic server log file is dynamic one.
    The log contains somestring and xml files, those string are writen by logger tool. only i want to retrieve logger tool msgs.
    for eg.
    ####<Sep 21, 2006 10:04:39 AM GMT+05:30> <Debug> <CLA_JMS> <dscp06614> <cgServer> <ExecuteThread: '22' for queue: 'weblogic.kernel.Default'>
    <ServiceHeader>
    <HI_PCK_SYS>ORM</HI_PCK_SYS>
    <HI_PCK_USR>ALC</HI_PCK_USR> <HI_WORKSTRING_ORIGINATOR>SVI</HI_WORKSTRING_ORIGINATOR>
    <HI_WORKSTRING_MSG_ID>hostname-99ba23.10dcea555e2.-7ff8</HI_WORKSTRING_MSG_ID>
    </ServiceHeader>
    ####<Sep 21, 2006 10:04:39 AM GMT+05:30> <Debug> <CLA_JMS> <dscp06614> <cgServer> <ExecuteThread: '22' for queue: 'weblogic.kernel.Default'> <<anonymous>> <BEA1-02E4CB44E4DA812720BD> <000000>
    <con:OrderID>1033987</con:OrderID>
    <StateCode>SUCCESS</StateCode>
    from the above content i want to fetch following elements & write into a
    separate file as output.txt
    output.txt
    USER Order_ID SYS ORIGINATOR MSG_ID statecode
    ALC 1033987 ORM SVI 111 success
    ALC 1033989 ORM SVI 112 failure
    Anyone have idea how to get the string from the dynamic log file.
    we can achieve for static file by using :
    BufferedReader inputStream = new BufferedReader(new FileReader("cgServer.log"));
    PrintWriter outputStream = new PrintWriter(new FileWriter("log_output.txt"));
    But how do read the data from a dynamic file and put into static file.
    your suggestions are most welcome.
    Message was edited by: Paulraj_mm
    PaulrajDaniel

    Hi there, I am currently wanting to do the same thing. I would like to know what you ended up doing. Our log files get quite large (we log 8gigs a day), and the weblogic log files are 512MB each. Would scripting be better than java for this task? Our log files also run on multiple mservers on multiple servers, so searching for XML messages is on multiple servers, on multiple mservers is quite a daunting task to do manually!
    Thanks

  • I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I have written a binary file with a specific header format in LABVIEW 8.6 and tried  to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I can think of two possible stumbling blocks:
    What are your 8.6 options for "byte order" and "prepend array or string size"?
    Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
    LabVIEW Champion . Do more with less code and in less time .

  • Reading a 2GB file and writing to two differnt files based on a delimiter

    Good Morning!
    I have to to read the content of 2 gb file(main.txt) and copy its content into two other files based on a delimiter.The delimiter is '/'. Initially i have to start writing the contents of main.txt to copy1.txt as soon as i encounter a delimiter i have to write the contents to copy2.txt again if i encounter next delimiter i have to write the contents copy1.txt and so on
    This is my piece of code but it takes 20-25 minutes.How can i optimise this operation.efficiency is my problem
    try{
         FileInputStream fis = new FileInputStream ("main.txt");
         FileOutputStream foscopy1 = new FileOutputStream ("copy1.txt") ;
         FileOutputStream foscopy2 = new FileOutputStream ("copy2.txt") ;
         int iFlag=1;
         int s;
         while((s=fis.read())!=-1)
              System.out.println(iFlag);
              if (s=='/')
                   iFlag=-iFlag ;
              else{
         if (iFlag==1)
                        foscopy1.write(s);
    else
    foscopy2.write(s);
    if u canprovide code that would do a lot of good

    Perhaps you could use a StreamTokenizer on top of a BufferedReader since you are using text files... The buffered reader will buffer your input so that it doesn't have to perform IO on every byte read. Subsequently the output may also be buffered to enhance performance...
    StreamTokenizer st = new StreamTokenizer(new BufferedReader(new FileReader("main.txt")));
    st.whitespaceChars('/', '/');
    BufferedWriter out = new BufferedWriter(new FileWriter("copy1.txt"));
    //same with copy 2
    while (st.nextToken() != st.TT_EOF) { // while not end
      String s = st.sval;
      // determiine copy to write to, then write.
    }

  • Count MySQL rows based off Value in Dynamic Table

    Greetings all. I have 2 MySQL tables; 1 that contains the names of my classes.(Class A, Class, B, etc.) and 1 table that contains the names of students in each Class (for example Class A: John Doe; Class A: Susie Smith.; Class B: Jane Doe). In the 2nd table the Class name is in its own column and the student's name is in a 2nd column.
    I currently have a dynamic repeating table that lists the names of all of the classes from the 1st table. What I'm trying to do is add a second column to this repeating dynamic table that lists the number of students in each class. For example; Row 1 of the dynamic table would say "Class A | 5; Class B | 3; Class C | 7, etc.). The dynamic table works perfectly to list the class names. For the life of me I can't figure out how to perform a count for each class to insert in the repeating table. I will be adding more Classes which as why I'm trying to set up the counting query dynamically. So far I have only been able to figure out how to count the total rows in the 2nd table, or count the rows with a specified class name. Any advice or guidance on how to count the number of rows in the 2nd MySQL table based off the class name in the repeating table is much appreciated. Thank you for any and all help. Have a great day.

    Select count(*), Class from MyTable
    Group by Class
    Time to learn about SQL:
    http://www.w3schools.com/sql/sql_intro.asp

Maybe you are looking for

  • How do I delete multiple bookmarks in FF 10.0.1?

    For some reason,I am seeing multiple copies of bookmarks for the same site,and lately they seem to multiply like rabbits.Is there a way to select all the duplicates,and erase in one go? Thanks!

  • Most efficient way to load XML file data into tables

    I have a complex XML file running into MBs. I want to load it's data into 7-8 tables. Which way will be better: 1) Use SQL Loader to actually load directly into the 7-8 tables directly by modifying the control card. Is this really possible and feasib

  • BSP compression / length of session ID in portal

    Hi everybody, we are calling a BSP application from within the portal. The HTTP compression does not work for the application. When calling the BSP application outside the portal everything is ok. So the settings for the BSP itself must be ok. What w

  • Roles Cancelling Each Other

    I have 2 roles that allows a user to create certain order types using tcode IW31: - Role1 can create order type Z1, Z2, Z3. - Role2 can only create order type ZT. Used to be that these roles go to different group people, never together. We now want t

  • PO Form text.

    Hi! Could the PO FORM text of terms and conditions can be canfigured and in different cases different terms and condition and be defaulted through configuration ? Thanks and regards, Suranjana