Count the no of irritation in for each loop

I want to count no of irritation in the for each loop container.
Thank you for the help.

If I were using C#, I would do something like that:
First I would define another counter variable
int anotherCounter=0;
then, in for each loop I would parse your text by splitting from the pipe characters. If it matches the value I want, i simply increment the counter.
string[] strColumnArr = strLine.Split("|".ToCharArray());
if (strColumnArr.Length > 0)
if (strColumnArr[1] == "myValue") anotherCounter++;
smalkim - MCT, MCSD, MS, MCPS

Similar Messages

  • SSIS For Each Loop Container

    Hello All,
    I have some files within sub folders. Below is the layout 
    C:\Source\01012015\Sample_1.csv
    C:\Source\01012015\Sample_2.csv
    C:\Source\02012015\Sample_1.csv
    C:\Source\02012015\Sample_2.csv
    C:\Source\03012015\Sample_1.csv
    C:\Source\03012015\Sample_2.csv
    I want
    to copy entire folder contents from source to destination including the sub folders and the files
    I am using for each loop container which reads the files form 01012015 folder, is there any way to read
    all the files from each and every folder(01012015, 02012015,03012015)?
    The destination should be like this. 
    C:\Archive\01012015\Sample_1.csv
    C:\Archive\01012015\Sample_2.csv
    C:\Archive\02012015\Sample_1.csv
    C:\Archive\02012015\Sample_2.csv
    C:\Archive\03012015\Sample_1.csv
    C:\Archive\03012015\Sample_2.csv
    Thanks, Shyam.

    Hi Shyam,
    According to your description, you want to copy entire folder contents including the sub folders and the files from source to destination.
    Based on my research, we should use Foreach File Container together with File System Task to achieve your requirement. For more details, please refer to the following links:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/4d99ebef-df43-44ad-9794-1d729cbf52e9/ssis-foreach-loop-copy-within-subfolders
    http://www.sql-programmers.com/for-each-loop-container.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Create Store Procedure to Count Number of records in Database for each table

    Hello,
    I have created the code which counts the number of records for each table in database. However, I want create store procedure for this code this code that when ever use execute the Store Procedure can provide the database name to execute it and as a result
    table will display number of records in each table.
    Below you will find the code its working:
    CREATE
    TABLE #TEMPCOUNT
    (TABLENAME
    NVARCHAR(128),
    RECORD_COUNT BIGINT)
    -- Creating a TEMP table
    EXEC
    sp_msforeachtable
    'insert #tempcount select ''?'', count(*) from ? with (nolock)'
    SELECT
    * FROM
    #TEMPCOUNT
    ORDER
    BY TABLENAME
    DROP
    TABLE #TEMPCOUNT
    This code need to be convert in store procedure and user can give database name when execute the procedure in order to count the records.
    Looking forward for your support.
    Thanks.
    SharePoint_Consultant_EMEA

    Something like:
    set quoted_identifier off
    go
    create procedure usp_TableCounts
    @DBName as varchar(1000)
    as
    set nocount on
    declare @SQLToExecute varchar(1000)
    CREATE TABLE #TEMPCOUNT (TABLENAME NVARCHAR(128), RECORD_COUNT BIGINT) -- Creating a TEMP table
    set @SQLToExecute = @DBName + ".dbo.sp_msforeachtable 'insert into #tempcount select ''?'', count(*) from ? with (nolock)'"
    print @SQLToExecute
    exec (@SQLToExecute)
    SELECT * FROM #TEMPCOUNT
    ORDER BY TABLENAME
    DROP TABLE #TEMPCOUNT
    GO
    Satish Kartan www.sqlfood.com

  • "for each" loop - under the hood question

    Question about the for each loop. Is it optomized? I think this is a poor use of memory management -
    for (int i = 0; i < stop; i++) {
    Object obj = new Object();
    doSomething(obj);
    }And this is the ideal, using the same object -
    Object obj = new Object();
    for (int i = 0; i < stop; i++) {
    doSomething(obj);
    }So underneath the hood, which is the for each loop comparable to? I love the syntax, it's very clean-looking in the code, but at the same time I don't want to hurt performance.

    Question about the for each loop. Is it optomized? I
    think this is a poor use of memory management -
    for (int i = 0; i < stop; i++) {
    Object obj = new Object();
    doSomething(obj);
    }And this is the ideal, using the same object -
    Object obj = new Object();
    for (int i = 0; i < stop; i++) {
    doSomething(obj);
    }So underneath the hood, which is the for each loop
    comparable to? I love the syntax, it's very
    clean-looking in the code, but at the same time I
    don't want to hurt performance.That depends on YOU. You CANNOT write a for-each loop for the code you provided. A for-each loop requires an Iterable. (I think that's what it requires--it at least requires something to iterate over, not just an index variable as you have.)
    Consider the following, however:
    Object o1 = new Object();
    for (Foo foo : fooList) {
        Object o2 = new Object();
         foo.doStuff(o1, o2);
    } It will be equivalent to this:Object o1 = new Object();
    for (Iterator iter = foo.iterator(); iter.hasNext();) {
        Foo foo = (Foo)iter.next();
        Object o2 = new Object();
        foo.doStuf(o1, o2);
    } How could it be any different? It has to keep the behvior of the "old fashioned" iteration.

  • For Each Loop: Enumerator Configuration In the For each loop Editor Help needed

    Hi All,
    I have a package that runs and updates a table with everytime someone adds a flat file in the source folder. One of the requirement is to upload files with the following
    ACA Flat files will have a naming convention of “ACA_ccyy_<julian date>”  : How can I add this?
    Under Files this is how I have setup the qualifies "ACA_*.*"
    Is there anyway to pass the entire naming convention in the file section? If so how can I ?
    Please help?
    FM

    As you have ACA_*.* set in Files Filter, it will return all the files from the folder which start with ACA_.
    You can have one dummy Sequence Container inside FE Loop Container. Connect it to your starting task and do right click on Precedence Constraint and write the expression the way you want by using SSIS functions. If the expression is evaluated to True only
    then it will go to the next task.
    In this way you can skip Non-ACA files.
    Please refer:
    SSIS Skip Certain Files in a For Each Loop
    - Vaibhav

  • What are the usage caps, if any for each DSL plan?

    Hello Verizon users and staff.
    I am considering purchasing one of your DSL plans, and I am wondering what the maximum usage cap is for each plan. I can not find this information officially on this website, but I read on another website that the cap was around 5GB a month. If someone could tell me the usage limit for all three plans, I would appreciate it!
    Thank you,
    --kosmos

    There are no usage caps for the DSL plans. DSL is not a pay-per-usage service. You pay for the service and you can use it as much as you want. The 5 gig cap is ONLY for the data plans from Verizon Wireless for tethering from your phone, etc.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • I need an app or software that records the date/time each time a write something and press enter. This needs to be quick so I can continue writing right after I press enter, and the date/time is inserted for each word. Does this sort of software exist?

    I need an app or software that records the date/time each time a write something and press enter. This needs to be quick so I can continue writing right after I press enter, and the date/time is inserted for each word. Imagine a spreadsheet - each time a write something in a cell and press enter to go into the next cell, I need the app/software to automatically insert the corresponding dat and time. Does this sort of software exist?

    No one here is going to do anything about it. Send feedback to Apple.
    http://www.apple.com/feedback/ipad.html
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 

  • How to set the gain and input coupling for each channel on a NI 4462 DaQ card?

    I've seen a few examples in how to set the gain for NI 4462, but none tell me how to chose the channel I wish to set this gain.  Also the same problem with input coupling
    Does anyone know how to set the gain and input coupling for each individual channel?
    Thanks,
    Hector
    LabView 8.5 Windows XP

    Hey Hector,
    http://forums.ni.com/ni/board/message?board.id=100&thread.id=1688
    This has a few examples of how to do that.  Let me know if you have further questions.
    Have fun!
    -gaving

  • Get the Excel file creatoin Date through For Each Loop each excel file in SSIS

    I had  For Each Loop
    in Collection Path had 2 files it had Creation date of 25/01/2014
    So I want Update in Table that date as File_Receive_Date column
    How Can I do ??
    in variable I am using VFile_FULL_Name(=Filename with Path by attach to Foreach loop collection&connection manager)
    which other System Variable to use in SSIS  ??
    I have created vRef_Date  but in Expression =====??? what should I do through only SSIS ??
    Thanks
    Madhu

    The easiest approach is https://filepropertiestask.codeplex.com/ can capture the file creation date, but it is not working for all SSIS versions
    I recommend using .net FILE IO libraries to get the created date which needs to be done in a Script Task.
    The ForLoop approach will not let you achieve this goal.
    Arthur
    MyBlog
    Twitter

  • For Each Loop in Jdev 10.1.2.17.84

    Is there anyway of using a for each loop in Jdev 10.1.2.17.84? I get errors for the standard syntax:
    for (int item : numbers) {
    System.out.println("Count is: " + item); }
    Am i missing something?

    Okay, i'm on 10.1.3 now and the syntax:
    for (int item : numbers) {
    System.out.println("Count is: " + item); }
    still doesn't work. What am I missing now?
    On compile I'm getting:
    Error(41,23): ; expected
    for the line with for (int item : numbers) {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Using IF in a for each loop which is grouped by two fields

    Hi ,
    My requirement is to filter the Payment records ,based on the parameter input date and also group by based on two of the Fields and calculate the sum of the payment Amounts.
    I have created a for each loop with the group by first on one field and then the other field.
    My question is where should I put my IF condition based on parameter dates ?
    If condition would be if Created = Date Parameter .CAn anybody help where I should insert the IF condition in the below code.
    Ex:
    <?for-each-group:Payments;./Created?>
    Display Date : Created
    <?for-each-group:current-group();./CreatedByName?>
    Table      :      CreatedByName     count of Payments           Sum of Amount
    <?end for-each-group?>
    <?end for-each-group?>
    thanks.

    Hi ,
    I got the result by putting the filter in [ ]
    Ex:
    <?for-each-group:Payments[PaymentStatus != 'New';./CreatedDate?>
    here I am filtering the records based on [Payment Status != New] and then group by Created Date .
    Similarly I can new another condition as well in the same statement
    <?for-each-group:Payments[PaymentStatus != 'New'][PaymentMethod != 'Cash'];./CreatedDate?>
    Regards.

  • For each loop start on odd page number

    Hy,
    I've an rtf template with a for each loop. I want to skip a page between each loop and to start each new loop on an odd page number (duplex printing). It's easy to skip a page but i don't know how to start each loop on an odd page. i've tried this before or after my for-each
    <?section:force-page-count;'end-on-even-layout'?>
    but it doesn't work for me.
    Sorry for my english
    regards

    One way of doing this is to create an object (B_1) at the end of the report and only have the object print if the current page is an odd page.
    - To force the page break, you need to set the "page break before" property against "B_1".
    - To test the page number in the format trigger use the srw.get_page_num(page_num out number) built-in function.
    You need to make sure that "B_1" is formatted after all the other objects in the layout. One way of ensuring this is to create a frame around all the other objects and make the frame variable. Any objects that come below the frame will be formatted after the variable frame.
    There is still the issue of any margin objects. Since margin objects print before any objects in the body, your margin objects will still print in the overflow page. However, this may be what you want if you're printing the page number in the margin.

  • How to use for each loop in XSLT when my source is a multilayout file and db

    How do I use a for each loop in XSLT when my source is multilayout file and db .
    My multilayout file is basically contain 2 kind of data one for employee and another for dependent.
    Now my requirement is I want to read each line of data whether it is it is employee or dependent do a join with db and write it in my target file.
    eg :  File content
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar 456782 BRO RichaKumari 311289 INDIA
    2 Ravi            456882 BRO RichaKumari 311289 INDIA
    eg : db Content
    311289 RichaKumari TCS INDIA Bangalore [email protected]
    Now in Final File I need something like this :
    1 RichaKumari 311289 TCS INDIA
    2 KiarnKumar RichaKumari 311289 TCS INDIA
    2 Ravi            RichaKumari 311289 TCS INDIA
    here 1 and 2 are the identifier which will decide which layout to follow .

    Hi,
    I think you'll need two nested for-each's... Something like...
    <xsl:for-each select="$root/row[layout = 1]">
    <xsl:variable name="employee" select="."/>
    ... write employee ...
    <xsl:for-each select="$root/row[layout = 2 and dependentid = $employee/id]">
    ... write dependent ...
    </xsl:for-each>
    </xsl:for-each>
    Cheers,
    Vlad

  • Loading accdb file using for each loop in to single target table

    I have 3 accdb file as below in single folder, in control flow I have created a for each loop to loop through all the below file.  In dataflow task I have created oledb source using connection manager to point to first file a1.accdb. I am trying
    to load all the file into single below mentioned target table, here It is only loading first file it is not looping through other two file.
    This I have tried to load .txt files and csv files it is working perfectly but similarly when I try to load access db file table it is not working, can any one of you help me?
    1. a1.accdb contains only one table  a1tab ( col1 col2 col3 )  
    2. a2.accdb  contains only one table  a2tab  ( col1 col2 col3 )
    3. a3.accdb  contains only one table  a3tab   ( col1 col2 col3 )
    I have a target table with similar structure as source
    Target table <TargetTable> Col1 Col2 Col3
    aak

    Thanks Arthur, please find below response
    How do you handle the different table names?  Cant we handle it in a similar manner, how we handle the .csv/.txt files with different name and similar structure for sources(multiple files) and target (single table)
    Is it good to drop the idea of for each loop and create a separate task for each accdb file? to be loaded to same target table( performance wise etc.. any justification would be helpful)
    You must handle the connection string dynamically?
    Can you help me with the logic for handling connection string dynamically
    aak

  • For-each loop in OSB

    Hi,
    I have a senario where i have a varied length XMl is coming to me in response of a service callout, and I need to iterate over it to get the fieldvalue of a particular tag based on its fieldName(e.g FUNCTION_CODE) and assign to a tag of another xml for example
    THE XML Coming as response of service callout is
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <getDefaultValueResponse xmlns="http://data.transformation.nab.cz.fc.ofss.com">
    <getDefaultValueReturn>
    <fieldDefaultValue>F</fieldDefaultValue>
    <fieldName>FUNCTION_CODE</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>PAYMENT_TRANSACTION_ID</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>CHANNEL_ID</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>CR</fieldDefaultValue>
    <fieldName>CREDIT_DEBIT_FLAG</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>BRAND</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>001</fieldDefaultValue>
    <fieldName>ACCOUNT_STATUS</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>Mr</fieldDefaultValue>
    <fieldName>NAME_TITLE</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue>Y</fieldDefaultValue>
    <fieldName>MAIL_RETURN_INDICATOR</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>ENTITY</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>TRANSACTION_CURRENCY</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>VERSION</fieldName>
    </getDefaultValueReturn>
    <getDefaultValueReturn>
    <fieldDefaultValue xsi:nil="true"/>
    <fieldName>TRANSACTION_RATE</fieldName>
    </getDefaultValueReturn>
    </getDefaultValueResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    and i want to assign that value to transactionType tag of
    <?xml version="1.0" encoding="UTF-8"?>
    <tns:sandstonetns xmlns:tns="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com Sandstone_Data_Transaction_History_Response.xsd ">
    <tns:listOfTransactions>
    <tns:transactions>
    <tns:clients>
    <tns:clientID>tns:clientID</tns:clientID>
    </tns:clients>
    <tns:timestamp>2001-12-31T12:00:00</tns:timestamp>
    <tns:sequenceNumber>tns:sequenceNumber</tns:sequenceNumber>
    <tns:description>tns:description</tns:description>
    <tns:amount>0</tns:amount>
    <tns:accountNumber>tns:accountNumber</tns:accountNumber>
    <tns:debitOrCreditFlag>tns:debitOrCreditFlag</tns:debitOrCreditFlag>
    <tns:*transactionType*>tns:transactionType</tns:transactionType>
    </tns:transactions>
    </tns:listOfTransactions>
    <tns:returnResponse>
    <tns:returnCode>0</tns:returnCode>
    <tns:returnDescription>tns:returnDescription</tns:returnDescription>
    </tns:returnResponse>
    </tns:sandstonetns>
    I want to achieve this using for-each loop...kindly help me as I dont have any idea about how to use for-each loop...

    i want to select a the tag fieldValue based on the data in tag fieldName for eg if i iterate over the whole response XML searching for fieldName=FUNCTION_CODE then I whuold get the value 'F' and then I would assign this value 'F' to the transactionType tag of the XML
    <?xml version="1.0" encoding="UTF-8"?>
    <tns:sandstonetns xmlns:tns="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com Sandstone_Data_Transaction_History_Response.xsd ">
    <tns:listOfTransactions>
    <tns:transactions>
    <tns:clients>
    <tns:clientID>tns:clientID</tns:clientID>
    </tns:clients>
    <tns:timestamp>2001-12-31T12:00:00</tns:timestamp>
    <tns:sequenceNumber>tns:sequenceNumber</tns:sequenceNumber>
    <tns:description>tns:description</tns:description>
    <tns:amount>0</tns:amount>
    <tns:accountNumber>tns:accountNumber</tns:accountNumber>
    <tns:debitOrCreditFlag>tns:debitOrCreditFlag</tns:debitOrCreditFlag>
    *<tns:transactionType>tns:transactionType</tns:transactionType>*
    </tns:transactions>
    </tns:listOfTransactions>
    <tns:returnResponse>
    <tns:returnCode>0</tns:returnCode>
    <tns:returnDescription>tns:returnDescription</tns:returnDescription>
    </tns:returnResponse>
    </tns:sandstonetns>

Maybe you are looking for

  • New field in condition record for batch determination

    Hi Gurus, I'm trying to create a new batch determination transaction OMA1 and I have found that the fields I need are not displayed in either KOMGH Maintenance, KOMKH Determination header, KOMPH Determination item. My question is has anyone entered n

  • Ideapad u330p Screen Flickers

    I own a Lenovo Ideapad u330p for 3months now. Recently, I realised that my laptop screen is flickering like a CRT monitor and it is causing me severe headaches when I use it. Also, there is a horizontal white dotted line at the top of the screen. Can

  • To unlock a delivery order number during PGI

    hi, Whenver a PGI is done the deliver order number gets locked within the transaction. Can someone suggest me how to unlock this delivery number. there is a funcion module used to Enqueue and Dequeue this order number. can someone suggest the name of

  • Help for keychain **** er

    A few weeks ago, I was having some trouble with keychain. I've never understood how it worked very well, so I hit the "reset" button. Worst mistake I've ever made! Now, many times when I try to do something I get a "System Preferences want to use the

  • Can't send form mail

    This works fine! <html> <head> <title>Mailform example</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="formmail" action="/cgi-bin/formmail/formmail.cgi" method="post"> <input type=hidden nam