How to put record set in loop

Using the follwing query
select distinct code from oalr where code > '" & AlertCode & "' and  code<=('" & code & "') "
i got 5 records eg :5603,5604,5605,5606,5607
record set fetching
Ocode = CStr(rs4.Fields.Item(0).Value)
Here  Ocode get only last record eg :5607, i want to take this 5 records in the loop how can i write the coding

Thank for ur reply,
But i not passing this in to matrix , i m going to pass the value in to anothe record set
eg
Ocode = CStr(rs4.Fields.Item(0).Value)
select A.code,A.MsgData,B.UserSign,C.Portnum as MobileNum from OALR A inner join ALT1 B on A.Tcode=B.code inner join OUSR  c on C.UserID=B.UserSign where  A.code='" & Trim(Ocode) & "' ")
I want to pass the Ocode value in to the loop.becoz only one value pass this query next time pass means duplicate value prob occure so i want to pass the Ocode value up to EOF. Give some solution

Similar Messages

  • How to pass record set as procedure parameter.

    Hi All,
    I have a requirement, I want to pass the records that are fetched from a cursor to a procedure as a parameter.
    I dont want to use it inside the loop as we do it normally, as i might get huge volume of records using cursor, as a result the procedure also will be called number of times inside the loop.
    Can you suggest me the logic along with sample code?
    Thanks
    Suresh

    GSKumar wrote:
    I have a requirement, I want to pass the records that are fetched from a cursor to a procedure as a parameter.A cursor outputs rows - not "records".
    I dont want to use it inside the loop as we do it normally, as i might get huge volume of records using cursor, as a result the procedure also will be called number of times inside the loop.
    Can you suggest me the logic along with sample code?How else do you want to do it? If there are a million rows returned by the cursor, it means a million executions of that procedure - once for every row.
    This will be slow. And the primary reason is that executing a PL/SQL procedure (or any other code unit) for a million times, will be slow. Changing the cursor interface (from an implicit cursor to a ref cursor for example) does not change the fact there needs to be a million PL/SQL procedure executions - and does not make anything faster. To fetch rows from a cursor needs to a loop. Period.
    There are two basic ways to address this issue at hand.
    Use SQL and not PL/SQL. Instead of using PL/SQL code and logic, use SQL code and logic. This will be faster as the PL/SQL engine no longer plays a role and a million rows do not have to be send from the SQL engine to the PL/SQL engine. Instead that million rows are processed internally in the SQL engine - which will be faster. And which will provide scalable options such as using parallel query.
    Use "multi-threaded" PL/SQL. Assuming the PL/SQL code and logic are too complex to be done in SQL, the next best choice is PL/SQL. However, a single serialised PL/SQL process going through a million rows will be slow and will not scale. If parallel PL/SQL can be used, then 20 PL/SQL processes can each do 50,000 rows - as oppose to having to do a million rows.
    There are two options to "multi-thread" PL/SQL code. You can use DBMS_PARALLEL_EXECUTE (11g). You can use a parallel pipelined table function (10g and higher).

  • How to put records in database from java coding?

    I want to insert records in the database from java code. Please help me out. Can i get a sample code for that.

    Google for JDBC tutorial. (...or read about hibernate)
    Kaj

  • How can I set one loop's frequency as a slave of another loop ?

    I have 2 loops in parallel. The first runs at 500Hz. The AIread controls the frequency. How can I set the second one at 100Hz ? It is very easy to set it with local variable, but really not clean. The second loop must not use the CPU while waiting the next 100Hz tick. Is it possible ? I am trying to use occurrence, but the second loop will always (I think) use CPU while waiting next tick !
    Is it possible to set one loop in one thread and the other one in another thread ? Then set each thread to a CPU (I use a bi-xeon PC)
    Thanks

    cariboo wrote in news:5065000000080000001EBE0000-
    [email protected]:
    > I have 2 loops in parallel. The first runs at 500Hz. The AIread
    > controls the frequency. How can I set the second one at 100Hz ? It is
    > very easy to set it with local variable, but really not clean. The
    > second loop must not use the CPU while waiting the next 100Hz tick. Is
    > it possible ? I am trying to use occurrence, but the second loop will
    > always (I think) use CPU while waiting next tick !
    > Is it possible to set one loop in one thread and the other one in
    > another thread ? Then set each thread to a CPU (I use a bi-xeon PC)
    > Thanks
    One solution is to place a case inside the loop which run at 500 Hz. Put
    your 100Hz code inside the True case. Use the "Quot
    ient & Remainder"
    funtion and the iteration counter to execute the true case every fift
    execution of the 500Hz loop.
    This may not work if the 100Hz code use to much time, it will then delay
    the 500Hz loop.
    I would go for the occurences solution. The wait will use some CPU
    resources while waiting but i don't think that should be any problem (when
    done correctly).
    Rolf

  • How to devide the set of records into groups in SQL itself.

    Hi , i am using 10.2.4.0 of oracle.
    I am having one requirement, in which i have to devide the set of records into certain groups , so that they can be executed partly but not in one run.
    So in the 'SELECT' clause itself i want to asssign particular value (may be 1 )to first 50000 records then another value(may be 2) to next 10000, like wise. And again the total count of records will also varry time to time , if the total count of record set is less than 10000 , then it should only assign '1' to all the records. i will set the group values (1,2,3...) as another column itself.
    Can you please let me know if this can be done in SQL without going for PLSQL?

    Hi,
    That's called a Pagination Query , and here's one way to do it:
    WITH     got_grp          AS
         SELECT     x.*
         ,     CEIL ( ROW_NUMBER () OVER (ORDER BY  x_id) 
                   / 50000
                   )          AS grp
         FROM     table_x  x
    --     WHERE     ...          -- If you need any filtering, put it here
    SELECT     *               -- Or list the columns you want
    FROM     got_grp
    WHERE     grp     = 1
    ;ROW_NUMBER () OVER (ORDER BY x_id)     assigns unique integers 1, 2, 3, ... to all all rows, in the same order as x_id (even if x_id is not unique).
    CEIL (ROW_NUMBER () OVER (ORDER BY x_id) / 50000)     maps the 1st 50,000 of those numbers to 1, the 2nd 50,000 to 2, and so on.
    Analytic functions (like ROW_NUMBER) as computed after the WHERE clause is applied, so, to use the results in a WHERE clause, then you need to compute them in a sub-query. If you just want to display the number, and not use it in a WHERE clause, then you don't need a sub-query.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • How to set a loop on an .flv so that an exported .swf loops?

    hi there. i am using Flash CS4 and I would like to know how to set a loop in an flv file so that when it is exported to swf, the movie will loop. Basically i have taken an existing interactive flash movie and have decompiled it into its individual flv counterparts. what i intend to do is take out all the nonsense from each flv file and then reconstruct the flash movie, export each file to swf and then convert each swf to avi or some other video format. to do this i will be using sothink swf to avi converter which allows you to convert swf files to avi files. this program allows you to convert swf files that loop by looping the swf file for as long as you want until you stop it, in which a video file is created from "the recording"
    after i decompiled the original file, many of the existing flv files were already set to loop. i know this because when exported to swf the swf file would loop. now when i went ahead and went into each flv file to edit a couple things, when i went to export them to swf, the swf files wouldn't loop. mind you, some of them did loop, and some of them did not loop. the ones i have edited are all supposed to loop and i cannot figure out what it is thats preventing some of the flv or exported swf files to loop. all i did was take out a few unnecessary frames from the beginning of each flv and nothing more. i am pretty new to Flash and do not know anything about coding and know very little about flash settings.
    i figured that selecting the "loop playback" option in the control drop down menu might help seeing as the flv file does loop when played in the editor, but again when exported to swf the swf file does not loop. what confuses me the most is that some of the exported swf files do loop. ALL of the exported swf files need to loop and my guess is that in order to make that happen, something in the flv file needs to be set correctly.
    can someone please assist me with this issue? if there is a way to simply loop an existing swf file that does not loop, can someone tell me how to do that? any help with this problem is greatly appreciated and i appologize if something like this has been asked before.... i just couldnt stand looking through 22 pages of search results to find the exact solution to my problem
    thank you!!!

    Hi,
    You can use shortDesc property. Something like
    <af:commandToolbarButton text="Some Button"
          id="ctb1" shortDesc="This button does something.."/>-Arun

  • I've had a hard drive crash and put in a new one.  However iTunes has or list all of them from my old drive.  How do we re-set the directory

    I've had a hard drive crash and put in a new one.  However iTunes has or list all of them from my old drive.  How do we re-set the directory?

    You can re-download the software from Download CS5.5 products
    Install and enter your serial number when prompted.
    Find your serial number quickly

  • How to get the record set into array?

    Hi,
    I want to get the record set into array in the procedure and do the processing of the array later in procedure.
    below is the stored procedure i am working on:
    procedure bulk_delete_group(p_group_id in Array_GroupListID) as
    begin
    for i in p_group_id.first..p_group_id.last loop
    --Here I have to get the list of user id before deleting group
    SELECT user_id into *<SOME ARRAY>* FROM group_members WHERE group_id = p_group_id(i);
    DELETE group WHERE group_id = p_group_id(i);
    --Process the user id array after group deletion..
    end loop;
    end bulk_delete_group;
    Thanks in advance
    Aditya

    Something like this ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.20
    satyaki>
    satyaki>
    satyaki>select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455         10
          7777 SOURAV     SLS                  14-SEP-08      45000       3400         10
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       4450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       7000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
    13 rows selected.
    Elapsed: 00:00:02.37
    satyaki>
    satyaki>create type np is table of number;
      2  /
    Type created.
    Elapsed: 00:00:03.32
    satyaki>
    satyaki>Create or Replace Procedure myProc(myArray np)
      2  is
      3    i   number(10);  
      4    rec emp%rowtype;  
      5  Begin  
      6    for i in 1..myArray.count
      7    loop  
      8      select *  
      9      into rec 
    10      from emp 
    11      where empno = myArray(i); 
    12     
    13      dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename); 
    14    end loop; 
    15  End myProc;
    16  /
    Procedure created.
    Elapsed: 00:00:00.88
    satyaki>
    satyaki>
    satyaki>declare
      2    v np:=np(9999,7777);  
      3  begin  
      4    myProc(v);  
      5  end;
      6  /
    Employee No:9999 Name:SATYAKI
    Employee No:7777 Name:SOURAV
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.30
    satyaki>Regards.
    Satyaki De.

  • How to generate a set of date type records

    How to generate a set of date-type records, with a fixed interval, starting from a date like 2008-01-01.

    Some thing like this
    SQL> select to_char(to_date('2008-01-01','yyyy-mm-dd') + (level - 1),'DD-MON-YYYY') my_date
      2    from dual
      3  connect by level <= 10
      4  /
    MY_DATE
    01-JAN-2008
    02-JAN-2008
    03-JAN-2008
    04-JAN-2008
    05-JAN-2008
    06-JAN-2008
    07-JAN-2008
    08-JAN-2008
    09-JAN-2008
    10-JAN-2008
    10 rows selected.

  • How to build dynamic databases(record set) for mobile?

    Hi All ,
    i have an applocation that needs to personalize the data for users .
    i have the data available , but dont know how to personalize it fot users to download special version of my application.
    how to build dynamic databases(record set) for mobile?

    In the load rule in the dimension build settings you would need to go to the tab dimension definition, choose the time dimension and right click on it. Select Edit properties. If you have not done so, set the dimension to be the time dimension. Then go to the generations/levels tab and set the generation names you need. For example if you want YTD, you would set the generation name to Year, if you want QTD set it to Quarter. You would set the number to the generation number that coorisponds to the generation. The DBAG has the list of names for all of the DTS members.

  • How to make this work selecting advanced record set dreamweaver complains and crashes all the time

    Hi There
    I have met a person who does php and sql work but not with dreamweaver. The code I have works but dreamweaver shows me an error with my record sets and it crash all the time.
    <?php require_once('../Connections/datexdatabase.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    if($_GET['pageID']==''){
        $pageId = 1;
    }else{
        $pageId = $_GET['pageID'];
    mysql_select_db($database_datexdatabase, $datexdatabase);
    $query_rsIndex = "SELECT pages.title, pages.meta_keywords, pages.meta_description, content.header, content.`description`
    FROM pages INNER JOIN content ON pages.id = content.page_id WHERE pages.id = ".$pageId." ORDER BY content.order";
    $rsIndex = mysql_query($query_rsIndex, $datexdatabase) or die(mysql_error());
    $row_rsIndex = mysql_fetch_assoc($rsIndex);
    $totalRows_rsIndex = mysql_num_rows($rsIndex);
    ?>
    <?php do { ?>
            <?php if($row_rsIndex['header'] != 'Introduction'){ ?>
            <b><?php echo $row_rsIndex['header']; ?></b>
            <?php } ?>
            <p><?php echo$row_rsIndex['description']; ?></p>
            <?php } while ($row_rsIndex = mysql_fetch_assoc($rsIndex)); ?>
    <?php
    mysql_free_result($rsIndex);
    ?>
    I am able to join the tables in the advanced recordset but i am getting confused with "" FROM pages INNER JOIN content ON pages.id = content.page_id WHERE pages.id = ".$pageId." ORDER BY content.order";"
    mysql_select_db($database_datexdatabase, $datexdatabase);
    $query_rsIndex = "SELECT pages.title, pages.meta_keywords, pages.meta_description, content.header, content.`description`
    FROM pages INNER JOIN content ON pages.id = content.page_id WHERE pages.id = ".$pageId." ORDER BY content.order";
    My question is how can I use dreamweaver with the advanced recordset with the pageID without dreamweaver crashing 20 times a day
    Regards

    My question is how can I use dreamweaver with the advanced recordset with the pageID without dreamweaver crashing 20 times a day
    Do you get any errors in Dreamweaver when it crashes?
    What version?
    What OS?
    Have you tried trashing recreating the user config folder ( http://kb2.adobe.com/cps/405/kb405604.html#main_user_config )?
    Have you tried trashing the preferences ( http://kb2.adobe.com/cps/839/cpsid_83912.html )?
    Has anything changed on the system recently (from program installs, to system / OS updates)?
    Have you tried creating a new user account on the system to verify there is no corruption in the current user's system data?

  • Problem while looping through record set and tem table for matching data

    hi I am using one record set and ane temp table and looping through both to find the match between dates.
    If date matches then it shud do some processing otherwise it will return default values(null values).
    FOR i IN student_rec .FIRST..student_rec .LAST          /*student_rec.school_date has 01-MAR-2012,02-MAR-2012,03-MAR-2012,04-MAR-2012,05-MAR-2012*/
    LOOP
    l_return_out.school_date := student_rec(i).school_date;
    l_return_out.marks_obtained := student_rec(i).marks_obtained;
    FOR i IN selected_dates .FIRST..selected_dates .LAST          /*selected_dates has 02-MAR-2012,03-MAR-2012,05-MAR-2012*/
    LOOP
    DBMS_OUTPUT.PUT_LINE(selected_dates(i));
    IF selected_dates(i)=student_rec(i).sett_date
    THEN
    EXIT;
    end if;
         ---------call procedure P1
    -----------get output as ret_val1               /*getting ret_val1 as 10 for 02-MAR-2012,03-MAR-2012,05-MAR-2012 */
         ----------call procedure P2
    ---------get ouput as ret_val2               /*getting ret_val1 as 20 for 02-MAR-2012,03-MAR-2012,05-MAR-2012 */
    if ret_val1>0 0r ret_val2>0
    then
    l_return_out.has_csts := yes;
    l_return_out.cst_present := 10;
    l_return_out.cst_absent := 20;
    else
    l_return_out.has_csts :=No;
    l_return_out.cst_present:= 0;
    l_return_out.cst_absent := 0;
    end if;
    end loop;
    l_return_out.has_cst := student_rec(i).has_csts;
    l_return_out.cst_missing := student_rec(i).cst_present;
    l_return_out.cst_existing := student_rec(i).cst_absent;
    PIPE ROW(l_return_out);
    END LOOP;
    RETURN ;
    I am expecting this as result
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          yes 10          20
    03-MAR-2012     40           yes 10          20
    04-MAR-2012     70          
    05-MAR-2012     60          yes 10          20
    but this as result
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          
    03-MAR-2012     40           
    04-MAR-2012     70          
    05-MAR-2012     60          
    Can anybody please highlight the mistake i am doing while processing the logic??
    Edited by: 942390 on Jul 13, 2012 8:44 PM
    Edited by: 942390 on Jul 13, 2012 8:45 PM

    I am getting a set values from a record set....student_rec
    and on pipelining this record set from 1st till last
    i am getting this
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          
    03-MAR-2012     40           
    04-MAR-2012     70          
    05-MAR-2012     60     
    so initially has_csts, cst_present and cst_absent is null for all dates.
    now have a temp table of selected_dates(which contains these dates 02-MAR-2012,03-MAR-2012,05-MAR-2012)
    now I am want to populate has_csts, cst_present and cst_absent with data only for those dates which is present in selected_dates temp table(02-MAR-2012,03-MAR-2012,05-MAR-2012) and that too has_csts, cst_present and cst_absent will be populated with some condition (based on the values from procedure got from P1 and P2).
    so want result set to look like
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          yes 10          20
    03-MAR-2012     40           yes 10          20
    04-MAR-2012     70          
    05-MAR-2012     60          yes 10          20
    so what could be the possible solution to obtained this....

  • How do you re-set an iPhone password when your child, the comedian, thought it was funny to change the four digit code, and now cannot remember what he put in? Thanks

    How do you re-set the four digit password when your son, the comedian, thinks it was funny to change the password, but now cannot remember what he changed it to? the phone goes inactive for 60 minutes, but I can't figure out how to get a reset.  Thanks, kel

    You're in trouble. You'll have to force the phone into recovery mode & restore it to remove the passcode:
    Leave the USB cable connected to your computer, but NOT your phone, iTunes running, press & hold the home button while connecting the USB cable to your dock connector, continue holding the home button until you see “Connect to iTunes” on the screen. You may now release the home button. iTunes should now display that it has detected your phone in recovery mode, if not quit and reopen iTunes. If you still don’t see the recovery message repeat these steps again. iTunes will give you the option to restore from a backup or set up as new.

  • Using a session object to hold the value of a record set?

    Hi,
    I'm trying to hold the value of a record set (or literally the content of a column in a query in a db) in a session variable so that I can call on this later and insert into another table.
    I'm not sure of the correct syntax, I've already made a connection to the DB. I'm trying the following but it doesnt seem to like the code:
    <% session.setAttribute("code",rs("column_name")); %>
    <%String attrib =
    String.valueOf ( session.getAttribute("code")); %>
    Hello <%= attrib %>
    Any ideas, I dont know how to reference the record set, I declared the recordset previously as rs. Help! Can't find examples anywhere on the net!

    So just to recap. I appear to be seeing the column name "custorderno" within the Microsoft Access query "lastcust". But I get "no data found" when I run the following code (which I have sectioned off)
    <!-- connect to database and lastcust query --!>
    <%
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/Tomcat/jakarta-tomcat-4.1.31/webapps/ROOT/Oatcake.mdb","","");
    Statement statement = conn.createStatement();
    String sql = "SELECT * FROM lastcust";
    ResultSet rs = statement.executeQuery(sql);
    while (rs.next()) {
    %>
    <TR><TD><%= rs.getString("custorderno") %></TD>
    </TR>
    <% session.setAttribute("code",rs.getString("custorderno")); %>
    <% String attrib =
    String.valueOf ( session.getAttribute("code") ); %>
    Hello <%= attrib %> [B]
    <%
    %>
    </TABLE>
    <%
    if (statement != null)
    statement.close();
    if (conn != null)
    conn.close();
    catch (Exception e) {out.print(e);}
    %>
    </BODY>
    </HTML>
    No as mentioned I am (as you can see) declaring everything as a string when in actual fact the contents of the "custorderno" within the query is set to a autonumber within MS Access.
    The while loop does work by returning the contents but the session object part is not working correctly with the following result returned:
    [B]java.sql.SQLException: No Data Found
    Help please!

  • How to put the file name in notepad file

    dear frank,
    how to put the file name in notepad file via power shell. I mean i want to put the file name in that notepad file
    for example,
    my file name is ABL and in this file data is
    02/06/2015,180.00,182.00,176.01,180.50,1575500
    02/06/2015,4.20,4.20,4.20,4.20,500
    02/06/2015,113.50,113.70,112.91,113.09,157800
    02/06/2015,682.01,695.90,682.00,683.19,4250
    02/06/2015,213.98,215.00,213.00,214.87,326200
    02/06/2015,21.52,21.65,21.52,21.60,4000
    02/06/2015,111.00,111.25,108.25,108.91,17100
    02/06/2015,52.00,52.00,52.00,52.00,500
    and i want to data in this form
    ABL,02/06/2015,180.00,182.00,176.01,180.50,1575500
    ABL,02/06/2015,4.20,4.20,4.20,4.20,500
    ABL,02/06/2015,113.50,113.70,112.91,113.09,157800
    ABL,02/06/2015,682.01,695.90,682.00,683.19,4250
    ABL,02/06/2015,213.98,215.00,213.00,214.87,326200
    ABL,02/06/2015,21.52,21.65,21.52,21.60,4000
    ABL,02/06/2015,111.00,111.25,108.25,108.91,17100
    ABL,02/06/2015,52.00,52.00,52.00,52.00,500
    There are many file like this that i want to be edit
    plese tell me how can i do it, i think it is possible via windows power shell.
    thanks in advance.

    Hi
    Just for completeness, what version of VB.NET are you using?
    Here is a complete project to copy all the files with the added "ABL," at the start of each line.  You need to start a new Project with a BLANK default Form1, and replace all of Form1 code with the code below. When you run this project, you
    need to use the 2 buttons to set up the ORIGINAL file folder and a folder to place the copies. You need to check if the file EXTENSION is correct (I assumed txt), and check the text to add to each line is correct.  Once all is set up you should have a
    big red button to start the operation.
    NOTE: it is important that you try this out on a copy of some of the files to verify accuracy BEFORE trying on original files. Make sure you have a good back up of the original files before doing anything else.
    ' new project with default BLANK Form1
    ' replace all Form1 code with this code
    ' WARNING: make sure you have a backup of
    ' any files you use this application to
    ' operate on.
    Option Strict On
    Option Infer Off
    Option Explicit On
    Public Class Form1
    Dim OrigFileFolderPath As String = Nothing
    Dim CopyToFolderPath As String = Nothing
    Dim lab1, lab2, lab3 As New Label
    Dim tb1, tb2, tb3 As New TextBox
    Dim b1, b2, b3, b4 As New Button
    Dim fb As New FolderBrowserDialog
    Dim bgw As New System.ComponentModel.BackgroundWorker
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Me.Size = New Size(731, 300)
    With lab1
    .Text = "Original Files Folder Path"
    .Location = New Point(15, 5)
    End With
    With tb1
    .Width = 560
    .Location = New Point(10, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab2
    .Text = "Copy Files to Folder Path"
    .Location = New Point(15, 125)
    End With
    With tb2
    .Width = 665
    .Location = New Point(10, 150)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab3
    .Text = "File Ext"
    .Location = New Point(600, 5)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With tb3
    .Text = ".txt"
    .Width = 80
    .Location = New Point(590, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .TextAlign = HorizontalAlignment.Center
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With b1
    .Text = "Choose Original Files Folder Path"
    .AutoSize = True
    .Location = New Point(10, 65)
    End With
    With b2
    .Text = "Choose Copy Files to Folder Path"
    .AutoSize = True
    .Location = New Point(10, 185)
    End With
    With b3
    .Text = "DO THE COPY"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    With b4
    .Text = "CANCEL JOB"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    Me.Controls.AddRange({lab1, lab2, lab3, tb1, tb2, tb3, b1, b2, b3, b4})
    With bgw
    .WorkerReportsProgress = True
    .WorkerSupportsCancellation = True
    End With
    AddHandler bgw.DoWork, AddressOf bgw_DoWork
    AddHandler bgw.RunWorkerCompleted, AddressOf bgw_Completed
    AddHandler b1.Click, AddressOf b1_Click
    AddHandler b2.Click, AddressOf b2_Click
    AddHandler b3.Click, AddressOf b3_Click
    AddHandler b4.Click, AddressOf b4_Click
    End Sub
    Private Sub b1_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = False
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb1.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b2_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = True
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb2.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b3_Click(sender As Object, e As EventArgs)
    b3.Visible = False
    b4.Visible = True
    If Not tb3.Text.StartsWith(".") Then tb3.Text = "." & tb3.Text
    bgw.RunWorkerAsync()
    End Sub
    Private Sub b4_Click(sender As Object, e As EventArgs)
    bgw.CancelAsync()
    End Sub
    Private Sub ReadPWFile(fn As String)
    Dim filename As String = My.Computer.FileSystem.GetName(fn)
    Dim barename As String = IO.Path.GetFileNameWithoutExtension(fn)
    Dim copyto As String = tb2.Text & "\" & filename
    Dim line As String = Nothing
    Dim lines As New List(Of String)
    Using sr As IO.StreamReader = New IO.StreamReader(fn)
    Do
    line = sr.ReadLine()
    If Not line = Nothing Then
    lines.Add(barename & "," & line)
    End If
    Loop Until line = Nothing
    End Using
    Using sw As IO.StreamWriter = New IO.StreamWriter(copyto)
    For Each s As String In lines
    sw.WriteLine(s)
    Next
    End Using
    End Sub
    Private Sub bgw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs)
    Dim ftc As Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(tb1.Text)
    For Each f As String In ftc
    If bgw.CancellationPending Then
    e.Cancel = True
    Exit For
    End If
    Dim ex As String = My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower
    If My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower = tb3.Text.ToLower Then
    ReadPWFile(f)
    End If
    Next
    End Sub
    Public Sub bgw_Completed(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs)
    tb1.Text = Nothing
    tb2.Text = Nothing
    b3.Visible = False
    b4.Visible = False
    MessageBox.Show("Finished copying files", "Job Completed")
    End Sub
    End Class
    Regards Les, Livingston, Scotland

Maybe you are looking for

  • How can I change an apple id on a computer?

    I am a new owner of a used MacBook, but I cannot install updates because it is linked to the old user's apple id.

  • Not able to add free item in PO

    dear all i am not able to add free items in already created import PO. when i add item and click on free item check box, system says "No delivery costs allowed without invoice receipt" and if i click on invoice receipt that item is no longer free ite

  • Patches 9706490 conplicts  9413827 / Upgrade 11.2.0.1 to 11.2.0.3

    Hi My 2-Nodes RAC-System on Linux RH 5.7/X86 hat die Version 11.2.0.1 I tried to upgrade it to 11.2.0.3 Following the recommendation in "Pre-requsite for 11.2.0.1 to 11.2.0.2 ASM Rolling Upgrade [ID 1274629.1]" Moderator edit - MOS Doc content remove

  • Offline Extraction Failure

    I tried to do an offline extraction from a Sybase 12.5 server. The login that I used was not 'sa', but one with sa_role. The process failed with a lot of 'Can not find libsrv.ddl ...' messages. What and where is that ddl? The second question is why c

  • Themes, "gists", etc., in Ultra Search

    I have a requirement to search files (network drives), database, and portal for keywords, search strings, themes, etc. I'm aware of the capability of interMedia to index and search text for keywords, phrases, themes and "gists" however, I have not fo