Powershell code,script Split - for each - how to?

Hello Good people,
case:
I've got an variabele ($post) wich can contain the next information (its posted with a form) and looks like :
A       B       C       D
anna   1       2       3
John
Roy
Sam
Values in A are sperated  a ;
Information can be different on each user post. Now I want to export for each A an csv file wich contains A B C D like:
A       B       C       D
Anna  1       2       3
A       B       C       D
John   1       2       3      etc.
The next lines are working fine for one A:
$export = "c:\CSV\" + $post."A" + "-" + $date + ".csv"
$post | Select "a","B","C","D" | export-csv $export -notype - delimiter ","
I want a unique file fo each A, so each file must contain their own A with the common BCD (labels) and their value. any ideas?
I'm a newbie in powershell and not a native English speaking so I hope my question is clear?
thx

Hi Roy,
I’m writing to just check in to see if the suggestions were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
If you have any feedback on our support, please click here.
Best Regards,
Anna Wang
TechNet Community Support

Similar Messages

  • HT2736 I bought iPads for my classroom and the district purchased the apps however they gave me codes to redeem for each app. How do I do that?

    I bought iPads for my classroom and the district purchased the apps however they gave me codes to redeem for each app. How do I do that?

    Try apple Configurator, if not contact apple support
    Apple Configurator Resources
    PDF: http://www.apple.com/iphone/business/docs/iOS_Apple_Configurator_Mar12.pdf
    Video: http://www.apple.com/education/resources/videos/#introduction-to-apple-configura tor
    Help Pages: http://help.apple.com/configurator/mac/1.0/

  • When I transferred my iPhoto from macbook to iMac it created double events for each, how do I correct this?

    When I transferred my iPhoto from macbook to iMac it created double events for each, how do I correct this?

    How did you do it?
    Here's what should work:
    To move an iPhoto Library to a new machine:
    Link the two Macs together: there are several ways to do this: Wireless Network,Firewire Target Disk Mode, Ethernet, or even just copy the Library to an external HD and then on to the new machine...
    But however you do choose to link the two machines...
    Simply copy the iPhoto Library from the Pictures Folder on the old Machine to the Pictures Folder on the new Machine.
    Then launch iPhoto. That's it.
    This moves photos, events, albums, books, keywords, slideshows and everything else.

  • HT3819 my kids got new ipads and I set up an apple id for each; how can I get the songs and apps we have already purchased for them from my apple id onto their new devices

    I understand that home sharing requires all devices to have the same apple id to access music, apps, books, etc.
    However, is there a way for my kids to share songs on separate apple ids so we don't have to buy 3 copies of the same song for our family?

    Turn on computer.
    Open itunes.
    Connect a device.
    Select what you want to sync.
    Sync
    Repeat for the otehr device

  • How to create diferents deliveries for each schedule line

    Dear gurus,
    I have sales orders with many schedule lines in order to deliver in diferents dates. We need to create all the deliveries together but each schedule line needs to be in a diferent delivery with the corresponding delivery date.
    I analiced the customizing about pool for delivery creation (VL10) but all I can change is for display and can not change the way the delivery is created. If we select two schedule line with diferent dates, the proccess create only one delivery with the total quantity and the first date of delivery.
    Anybody knows some way to make the proccess create individual deliveries from diferents schedule lines?
    Tanks in advance!
    Marina.

    Hello Marina
    I hope you are using VL10E. Did you try working with Delivery creation date (range) and Delivery Date calculation rule? For example if you go for a value of 2 for the CalcRuleDefltDlvCrDt ('Rule for determining default value for deliv. creation date), then system will consider only those sched lines which are to be delivered today and tomorrow.
    You also have the possibility of setting up your own routine for CalcRuleDefltDlvCrDt.
    Thirdly SAP has suggested a solution for Scheduling agreements ( valid for releases upto 4.7). In this SAP has suggested solution 4 for ensuring all schedule lines are not delivered together. You can customize the code to include Sales orders ( in stead of Sched Agreements)  in your case. Though it is for release 4.7, I think you can use the smae concept in ECC also.
    137937 - SD scheduling agreement: Delivery split for each schedule li
    Check it out and let me know how it goes. Good luck.

  • Pls help : How To select fields and data from user_table for each tablename

    Please help with the query to generate a output which selects the code,meaning,inuse for each table in the user_table that has "CODED" as a part of table name.
    User table has some 800 table that contains CODED in the tablename.
    Desc of the table:
    DESCPTION:
    Name Null? Type
    SHORT_NAME NOT NULL VARCHAR2(20)
    CODE NOT NULL VARCHAR2(4)
    MEANING NOT NULL VARCHAR2(240)
    IN_USE VARCHAR2(1)
    NOTES VARCHAR2(2000
    UNITS NOT NULL VARCHAR2(1)
    AMOUNT NOT NULL VARCHAR2(3)
    CONVERTED VARCHAR2(1)
    RUN_NAME VARCHAR2(30)
    But all the table have code, meaning,in_use fields.
    O/P format :
    TABLE_NAME CODE MEANING IN_USE
    Help me pls.

    Not 100% sure what you want. If you want to see all the tables that have all three of those columns, then you could do something like:
    SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
    FROM user_tab_columns
    WHERE column_name = 'CODE' and
          table_name like '%CODED%'
    INTERSECT
    SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
    FROM user_tab_columns
    WHERE column_name = 'MEANING' and
          table_name like '%CODED%'
    INTERSECT
    SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
    FROM user_tab_columns
    WHERE column_name = 'INUSE' and
          table_name like '%CODED%'If you want to select those three columns from each of the tables, then you could do something like this.
    Create a command file called, for example, makesel.sql that looks like:
    SET PAGES 0 lines 500 trimspool on feedback off;
    spool sel.sql;
    prompt spool selout.txt;
    SELECT 'SELECT '''||table_name||''', code, meaning, in_use FROM '||
           table_name||';'
    FROM (SELECT table_name
          FROM user_tab_columns
          WHERE column_name = 'CODE' and
                table_name like '%CODED%'
          INTERSECT
          SELECT table_name
          FROM user_tab_columns
          WHERE column_name = 'MEANING' and
                table_name like '%CODED%'
          INTERSECT
          SELECT table_name
          FROM user_tab_columns
          WHERE column_name = 'INUSE' and
                table_name like '%CODED%')
    prompt 'spool off;'
    spool off;
    @sel.sqlAt the sqlplus prompt run the file using @makesel.sql. This will create another file called sel.sql containing the commands to select those three columns from each table that has all three columns, then after the new file is created, it runs the file (@sel.sql). The output will be spooled to a file called selout.txt.
    HTH
    John

  • Delivery Split for PO

    I want to split delivery creation for 'NL' type of delivery for STPO i.e. 'UB' type.
    i.e. if a PO has 2 materials with different material types ( e.g FERT & HAWA ), then 2 different deliveries have to be created in this case automatically.
    How can the same be achieved.

    If you want a permanent Solution on this you will have to take the help of a Routine.
    If you want to manually force a delivery split for each line item in the Purchase Order, then give a different value in the "Unloading Point" field for each item.
    Unloading Point field is there at Item level in the Shipping Tab in PO.
    There are positives and negatives of this approach.
    Positive being that since Unloading Points are different for each line item in PO, there will be a seperate delivery for each line item.
    Negative is that since the Unloading Field value is defaulted from the PO into the delivery at header (Goto>Header>shipment) you will have a seperate Invoice for each delivery as the Unloading points are different for each delivery. You will not be able to have a consolidated Invoice.

  • Scripting Question for Remote & Command list

    There must be some info on the commands / functions allowed for DVDSP scripting. For instance, how does one know ran = random. div = divide. Can you please point me in that direction. Note: already looked at the 2 tutorial sites suggested and the book authors mentioned, and while those were helpful looking for a comprehensive list, or at least some list like so many of my other programming books contain.
    More advanced question: Does anyone know the scripting conversion for the remote control. For example
    if remote = play jump end....
    or
    if controller = next jump start...
    Not sure what the code would look like, but it must be fairly simple, and someone must know the answer:)
    Thanks!!!

    No probs. If you're more specific we could maybe help more. I mean you could write a script and then make the button target that script, or make all buttons target a script and make decisions based on which button was pressed... but there isn't always much point cause you dont have the interactivity level you do with Flash/Director,
    -jake
    P.S Thanks for coming back to the thread. To help the new system, when you feel the question has been answered can you mark it answered/helpful etc, cheers.

  • How to select a max row for each group in SQL ( with distinct code )

    Dear friends, 
    My table is as show in below…  for each ‘grpid’ I want get row with Max tiv value and code should be distinct. Ie in result, code & grpid will come only once.
    grpid
    code
    Tiv
    2
    GB
    9
    2
    IN
    7
    1
    GB
    11
    1
    US
    10
    Result:    ( we are selecting   IN even though for grpid 2
     ‘GB’ has max value )
    grpid
    code
    Tiv
    2
    IN
    7
    1
    GB
    11
    -Sajid

    Thanks for reply..
    please see my  DML+  DL
    CREATE TABLE [dbo].[tab](
    [grpid] [int] NOT NULL,
    [code] [varchar](2) NOT NULL,
    [Tiv] [int] NOT NULL
    ) ON [PRIMARY]
    delete from tab
    insert into tab values (2 , 'GB' ,12)
    insert into tab values (2 , 'IN' ,10)
    insert into tab values (1 , 'GB' ,11)
    insert into tab values (1 , 'US' ,10)
    insert into tab values (3 , 'GB' ,10)
    insert into tab values (3 , 'US' ,9)
    insert into tab values (3 , 'UA' ,10)
    insert into tab values (3 , 'IN' ,8)
    Result:
    grpid      code     
    tiv
    1             
    US          10
    2             
    GB          12
    3             
    UA          10
    Thanks in Advance..
    -Sajid
    CREATE TABLE [dbo].[tab](
    [grpid] [int] NOT NULL,
    [code] [varchar](2) NOT NULL,
    [Tiv] [int] NOT NULL
    ) ON [PRIMARY]
    delete from tab
    insert into tab values (2 , 'GB' ,12)
    insert into tab values (2 , 'IN' ,10)
    insert into tab values (1 , 'GB' ,11)
    insert into tab values (1 , 'US' ,10)
    insert into tab values (3 , 'GB' ,10)
    insert into tab values (3 , 'US' ,9)
    insert into tab values (3 , 'UA' ,10)
    insert into tab values (3 , 'IN' ,8)
    ;with mycte as
    (select grpid,code,tiv , row_number() over(Partition by code Order by Tiv DESC) rn1, row_number() over(Partition by grpid Order by Tiv DESC) rn2
    from tab)
    ,mycte1 as (Select *
    , row_number() over(Partition by grpid, rn1 Order by rn2 ASC) rn3
    from mycte
    WHERE rn1=1
    Select grpid,code,tiv from mycte1
    Where rn3=1
    drop table tab

  • How can I setup different number range for each company code?

    Dear GURU,
         Is it possible to setup different number range for material document by company code? If yes, what should i do.
         Thank you in advance.
    Thammarit

    Hi,
    you maintain the number assignment for the following documents:
    material documents
    physical inventory documents
    The number assignment for these documents is not to be confused with the number assignment for accounting documents . The number assignment for accounting documents depends on the document type which is allocated to the transaction.
    The number assignment for material documents and physical inventory documents depends on the transaction/event type which is also allocated to each transaction in Inventory Management. The transaction/event types are divided into groups of number ranges. A number range interval has to be defined for each group.
    You cannot change the transaction/event types. However, you can change the number range intervals or you can allocate transaction/event types to new groups.
    Caution: Change in the Fiscal Year
    If, at the time of a fiscal year change, you reset the number range in the new fiscal year, separate number range intervals for the previous year and for the current year must be maintained for one month to allow postings to the prior period.
    Example:
    Interval for 1995: 4900000000 to 4999999999 status: 4900451234
    Interval for 1996: 4900000000 to 4999999999 status: 4900000000
    If only one number range interval exists for both years and you make any postings to the previous period, the system will assign numbers that already exist in the previous year. This would lead to an update termination.
    In the standard system, the transaction/event types and number range intervals are preset for Inventory Management as follows:
    Physical inventory documents
    Number range interval from 0100000000 to 0199999999
    This group contains the following transaction/event types:
    - IB Physical inventory documents
    - ID Physical inventory documents for counts and differences
    without reference
    - IN Physical inventory documents for recounts
    - IZ Physical inventory documents for count without reference
    - WV Physical inventory documents for difference postings in the WM System
    Material documents for goods movements and inventory differences
    Number range interval from 4900000000 to 4999999999
    This group contains the following transaction/event types:
    - WA Goods issues, transfer postings, other goods receipts
    - WH Goods movements for handling units (HU)
    - WI Material documents for inventory adjustment postings
    - WL Goods issues for delivery documents (SD)
    - WQ Goods movements for usage decisions (QM)
    - WR Goods movements for completion confirmations (PP)
    - WS Goods movements for run schedule headers (PP)
    - WZ Documents for batch status changes
    Material documents for goods receipts
    Number range interval from 5000000000 to 5999999999
    This group contains the following transaction/event types:
    - WE Goods receipts for purchase orders
    - WF Goods receipts for production orders
    - WO Subsequent adjustment of subcontract orders
    - WW Subsequent adjustment of active ingredient materials
    Inventory sampling numbers
    Number range interval from 0200000000 to 0299999999
    This group contains the transaction/event type SI.
    SAP recommends that you accept the settings defined in the standard system. In this case, no action is required on your part.
    Note
    For performance reasons, 10 document numbers are buffered on the application server. In this way, gaps in number assignment can occur.
    Actions
    Check whether you can use the predefined groups and number intervals.
    If you want to change any groups, proceed as follows:
    a) Choose Group -> Maintain.
    b) Select the transaction/event type that you want to re-allocate.
    c) Place the cursor on the new group and choose Edit -> Assign element group).
    d) Save your settings.
    If you want to define new groups, proceed as follows:
    a) Select Group -> Maintain.
    b) Then select Group -> Insert.
    c) Enter a text for the number range group.
    d) Maintain the number interval for this number range group.
    e) Allocate the transaction/event types to the number range groups (see step 2).
    If you want to maintain new number range intervals for an existing group, proceed as follows:
    a) Choose Group -> Maintain.
    b) Select a group and choose Interval -> Maintain.
    c) Choose Edit -> Insert year.
    d) Maintain the number interval for the new fiscal year.
    If you do not want to use the year-related number assignment method, enter 9999 in the field Year.
    Note on transport
    You transport number range objects as follows:
    In the initial screen, choose Interval -> Transport.
    Note that all intervals for the selected number range object are deleted in the target system first. After the import, only the intervals you export are present. The number statuses are imported with their values at the time of export.
    Dependent tables are not transported or converted.
    Thanks and regards
    Rajesh

  • How to add a comment for each caption label present in a document?

    Hello everyone,
    I am trying to write a script to add comments for each caption label for figure and table.
    How can I select a caption and use Comments object for adding a comment?
    I tried using AutoCaptions list for going through all captions present in a document but Comments.Add function is not available with Caption object type.
    When I try adding a comment by selection manually I am able to add. Here is my piece of code.
    For Each objCaption In ActiveDocument.AutoCaptions
    objCaption.Comments.Add Range:=Para.Range, text:="[" & sIdLabel & sCurrentNumber & "]" & vbCrLf ' ID‘}
    ' increment number for next TAG
    sCurrentNumber = Format(Val(sCurrentNumber) + Val(sStepNumber), String(Len(sCurrentNumber), "0"))

    Hello Stefan,
    Thanks for your response.
    I'm trying to add comments for each table and figure present in my document.
    I have earlier tried a script to add comments for each outline level and it works.
    When I tried adding a feature to add comments for each caption in the document, it didn't work.
    Apparently when I try to go through the document by each para, captions are selected as para. So my current script is not able to parse though all the captions.
    Then I went with the other option where I'm trying to use AutoCaption object list to go through each caption. In this Caption object do not have Comment.Add function.

  • Cursors track on 4 2D displays in VIEW - but how do I get Coordinates to display for each instead of just the active display

    If DIADEM goes to the trouble of tracking the cursor on all the pages in a sheet I would think there is a NON-SCRIPT way to show the Y values for all. 
    My graphs are aligned on the X-axis (torque), 4 - 2D displays(1 each for RPM, HP, Current and Efficiency), and 10 plots on each of the 4 displays all in DIADEM 2010.
    The display coordinates box only shows active display and others are grayed out.  I've played around with the "Cursor Parameters" but that yields the same although what I add does show in the "Coordinates" dialog.  I assume it may have something to do with making it automatic but I see no way to change it and how do I assign it to a channel???
    On another note I'd like to be able to synchronize all 4 charts to be on the same plot(legend) to the above tracking and thus will read the same relevant data.  So if  plot 1 is selected on the RPM display then the other three will also be on plot 1.  I assume this would have to be done programmatically but if not I'm all ears.
    Solved!
    Go to Solution.
    Attachments:
    cursortracker.docx ‏284 KB

    Hi Tweedy -
    No, you can't use the .NET code directly in DIAdem.  I'm not sure what the point in suggesting it was, as it would take significant modification to be able to use similar code in DIAdem.
    Have you tried using the VIEW Legends?  Expand the legend for each graph and then double-click on the legend, at which point you can configure what information shows up about each curve.  By default, the legend will show the Curve Name, Curve Units, X-Position (of the cursor), and Y-Position (of the cursor).  Feel free to augment or contract this as needed for your preference.
    After expanding each legend, switch to the Curve Cursor, and you should be able to see the Y-Position of each curve, completely synchronized.
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • Remove T Code for each ROLE for user

    Hi Experts
    Can anyone tell me how to remove the T code for each role which was define individually for users Eg
    CR01 has been assign to 50 users, the difficulty is I have to go to each role then search for CR01 t code then delete and again generate the Authorization
    In this way there are so many t codes which I have to go one by one to delete it.
    Any help to remove the t-code for each role through any way.
    regards
    Piroz

    try the Security forum at Security
    they might have trick (such as CATT scripts).
    doing this via SQL commands is dangerous. avoid this solution if you are not 100% sure of its impact.

  • Can it be  a seperate cost component structure for each company code?

    Company Code No 1 Setting:
    Company Code XXXX with Chart of accounts X(Quantity + Value updation in material type)
    In the existing company code(XXXX) ,Cost component structure is defined as
    All company code---->All Plants----> All Costing Variants -
    >Cost component Structure AA
    Company Code No 2 Setting:
    Scenario:
    Now  I am creating a new company Code YYYY) which is  is allowed  for quantity updation  alone and  trying to create a product cost collector to carry out Production confirmation through Repetetive manufacturing (."Error = Cost object component split costed with Value of Zero"
    Can it be possible to have a seperate cost component structure for each company Code?
    Company Code YYYY with Chart of accounts Y which is different from Company code 1(Quantity  alone in material type)
    If possible ,Can anybody provide a procedure to do the configuration of Cost Component structure

    Hello,
    As I understand your question, All the thing which are releted to costing are done only at the controlling area level not at company code.
    As your req diffrent cost componenet for diffrent company code is depend up on how you define the controlling area.
    Hope it will clear you
    Regards
    Ravi

  • FillBy always fills in the same row in data grid view. How to make it fill in a new row for each click of the Fillby Button? VB 2010 EXPRESS?

    Hi there, 
    I am a beginner in Visual Basic Express 2010. I have a Point of Sale program that uses DataGridView to display records from an external microsoft access
    database using the fillby query. 
    It works, but it repopulates the same row each time, but i want to be able to display multiple records at the same time, a new row should be filled for
    each click of the fillby button. 
    also I want to be able to delete any records if the customer suddenly decides to not buy an item after it has already been entered. 
    so actually 2 questions here: 
    1. how to populate a new row for each click of the fillby button 
    2. how to delete records from data grid view after an item has been entered 
    Thanks 
    Vishwas

    Hello,
    The FillBy method loads data according to what the results are from the SELECT statement, so if there is one row then you get one row in the DataGridView, have two rows then two rows show up.
    Some examples
    Form load populates our dataset with all data as it was defined with a plain SELECT statement. Button1 loads via a query I created after the fact to filter on a column, the next button adds a new row to the existing data. When adding a new row it is appended
    to the current data displayed and the primary key is a negative value but the new key is shown after pressing the save button on the BindingNavigator or there are other ways to get the new key by manually adding the row to the backend table bypassing the Adapter.
    The following article with code shows this but does not address adapters.
    Conceptually speaking the code in the second code block shows how to get the new key
    Public Class Form1
    Private Sub StudentsBindingNavigatorSaveItem_Click(
    sender As Object, e As EventArgs) Handles StudentsBindingNavigatorSaveItem.Click
    Me.Validate()
    Me.StudentsBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'MyDataSet.Students' table. You can move, or remove it, as needed.
    Me.StudentsTableAdapter.Fill(Me.MyDataSet.Students)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Me.StudentsTableAdapter.FillBy(Me.MyDataSet.Students, ComboBox1.Text)
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Me.MyDataSet.Students.AddStudentsRow("Jane", "Adams", "Female")
    End Sub
    End Class
    Get new key taken from
    this article.
    Public Function AddNewRow(ByVal sender As Customer, ByRef Identfier As Integer) As Boolean
    Dim Success As Boolean = True
    Try
    Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
    Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
    cmd.CommandText = InsertStatement
    cmd.Parameters.AddWithValue("@CompanyName", sender.CompanyName)
    cmd.Parameters.AddWithValue("@ContactName", sender.ContactName)
    cmd.Parameters.AddWithValue("@ContactTitle", sender.ContactTitle)
    cn.Open()
    cmd.ExecuteNonQuery()
    cmd.CommandText = "Select @@Identity"
    Identfier = CInt(cmd.ExecuteScalar)
    End Using
    End Using
    Catch ex As Exception
    Success = False
    End Try
    Return Success
    End Function
    In closing I have not given you a solution but hopefully given you some stuff/logic to assist with this issue, if not perhaps I missed what you want conceptually speaking.
    Additional resources
    http://msdn.microsoft.com/en-us/library/fxsa23t6.aspx
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

Maybe you are looking for