Powershell: How to change the header name in a imported CSV file

HI All,
I have a csv file in which I want to change the headers names in powershell.
oldnames are name,id
newnames I want to give are: company and transit respectively.
Following is what I wrote in script:
           $a = import-csv .\finalexam\employees.csv -header name,id'
                   foreach ($a in $as[1-$as.count-1])  // I used 1 here because I want it to ignore the  exiting headers.
                  { $_.name -eq company, $_.id -eq transit}
I think this not entirely correct way to do this. Can someone show me how to fix this.
Regards
SQL 75

If you're not an experienced PowerShell programmer, I recommend editing the file in a text editor and changing the name that way.
-- Bill Stewart [Bill_Stewart]

Similar Messages

  • How to Change Journal Header name to Custom Header Name while GL Importing?

    Hello Experts,
    I am in situation where customer wanted to keep their own journal header naming conventions to imported journals in Oracle GL for custom Journal sources.
    As I know while importing journals, Oracle Creates the Journal Name based on the below mentioned logic.
    "Journal Import creates a default journal entry name using the following format:
    (Optional User-Entered REFERENCE4)(Category Name)(Currency)
    (Currency Conversion Type, if applicable)
    (Currency Conversion Rate, if applicable)
    (Currency Conversion Date, if applicable) (Encumbrance Type ID, if applicable)
    (Budget VersionID, if applicable). If you enter a journal entry name,
    Journal Import prepends the first 25 characters of your journal entry name to
    the above format"
    But then How it is possible to only allow journal header Name to be used present in REFERENCE4 excluding all other string provided by Oracle? Instead of using omitted string custmoer wanted to keep their own parameters. Example - REFERENCE4.A.B.C etc.
    Is it possible to solve this using seeded setup or modifying some hook packages or anything else?
    As far as I know there can be one workaround to be use of updating journal header name after journal import being completed successfully for custom journal source. But only fear is Oracle doesnt allow updating the base table without API. Am I rght?
    So it would be really great if anyone of you can suggest the best solution or best possible workaround.
    Thanks

    Duplicate - How to Change Journal Header name to Custom Header Name while GL Importing?

  • How to Change the Alias name for Internet user in SU01 tr code through cod?

    Hi Guys,
                 My req is we have to change the Alias name(SU01 tr code) for the existing users thru code.So can anybody tell me how to change the Alias name like which we do it in SU01 tr code thru code or FM.?
                Is there any FM for tha changing Alias Name?
    Thanks,
    Gopi.

    Hello Gopi Anne ,
                                 You can use the following FM / BAPI :
    BAPI_USER_CHANGE
    MY_BAPI_USER_CHANGE
    For BAPI_USER_CHANGE :
    You need to make use of the IMPORT parameter :
    ALIAS     TYPE     BAPIALIAS                               User Name Alias
    ALIASX     LIKE     BAPIALIASX                               User alias change flag
    Thanks,
    Greetson

  • How to change the folder name in the web report.

    hi experts,
    can anybody give me the solution, how to change the folder name in the web report. any help is appreciated.
    waiting for ur favourable response.
    thanks
    suri

    Hi Tony,
    Yes, the business requires, only to change in the webreport only not in bex and roles. any suggestions will be helpful to me.
    thanks
    surendra

  • How to change the bluetooth name? in my pc,

    Hi there!
    How to change the Bluetooth name for my N70.
    I can change it in my N70, but the first installed name still pops up on my computer. Can't find it anywhere so i can have the same name in my phone as on the computer. Is there some kind of registry that keeps the first name maybe??
    Any ideas?
    Owned: Nokia 1600 - 3120 - 5110 - 6110 - 7110 - 6310i - N70 - N72.
    Using now: 6310i & N70 - N72

    I am not sure about how to change SERVICE_NAME in PL/SQL Developer (if at all it can be done in that ), but you will have to change the SERVICE_NAME in the TNSNAMES.ORA file.
    1. Locate the entry for PLSExtProc in the file tnsnames.ora at:
    $ORACLE_HOME/network/admin/tnsnames.ora
    2. Change the SERVICE_NAME = ORCL
    3. Save and reconnect
    Aalap Sharma :)

  • I have a MacBook Pro, how to change the computer name in the "Find Iphone"

    I have a MacBook Pro, how to change the computer name in the "Find Iphone"?

    Thank you for help! I was inattentive reading your answer. The thing which confused me was that I noted in blue. I had to just write in a red box and close the configuration window.

  • Has anybody found out how to change the workgroup name in 10.5?

    I have been trying to connect to XP machine shared folders and it is not working.
    I've tried using smb and it gives connection error or says Ithe user has not permission in the machine
    I've started in 10.4 from backup disk and it is working OK.
    I see that in 10.4 it asked for DOMAIN/ Workgroup name , and this option has disappeared in 10.5
    Has anybody found out how to change the workgroup name in 10.5?

    System Preferences - Networking

  • HT1428 How to change the account name in Mac OS X via a command line. I did a type-o on the account name. So instead of it saying "Company" it says "Comany"  for the account logon.

    How to change the account name in Mac OS X via a command line. When I created the account I mistyped the name. I have a management suite where I can execute remote scripts. I would like to run a script that changes the name from oldname to newname.
    None of these Macs have been used currently.
    Thank you,
    Brian

    If user account shortname, see Changing user account shortname

  • How to change the "short name (account name?)" and home directory name?

    Hi,
    I recently purchased a new iMac and migrated account info from my MacBook Pro.  I happened to use random account name during migration without knowing it will not be easy to change the short name (account name?) and home directory name.  As a result, I am now having extremely confusing short name and home directory name on my new iMac.
    I did online search to find out how to change the two names, but I could only found somethig like "enabiling root user and....."  I have no idea what it was talking about and I don't want to take risk altering such advance set up manually.
    Please advice how I can change the short name and home directory name safely without much PC knowledge.
    Thank you very much in advance.

    There are a few ways of doing this. The easiest method is logging into the first account and copying everything to an external drive (or flash drive or whatever), which changes the permissions so that others can see the files.
    Then, login with the new account and copy the files over. Once they are copied, the correct permissions will be applied again (so other people on your computer can't access them).
    If you can't do this method for one reason or other, you can do some terminal commands to change the ownership of the files. Login to the new account. If it is an admin account, open terminal and type the following command:
    sudo chown -R -v yourusername:admin /Users/originalaccountnamehere
    That should change the ownership of the files from your old account to the new one. At that point, you can simply drag the files into place.

  • How to change the package name for a msg class

    Can anybody tell me how to change the package name for a message class.
    and how will it effect in the rerport?
    thanks in advance
    kp

    >>and how will it effect in the report?
    You wouldn't see any direct effect on the Report.. But if you transport the report to QA & leave the Message class in Dev, it might result in syntax issues & you will not be able to execute the report. Just ensure that both of them get transported to QA & you will be fine.
    ~Suresh

  • How to change the tooltip names for my navbar

    Hi,
    Does anyone know how to change the tooltop names on the navbar as i need it to say "Next" instead of "Forward"
    Thank guys

    For SWF you'll need to edit the applicable playbar.fla
    C:\Program Files\Adobe\Adobe Captivate 7 x64\Templates\PlaybackFLA\AS3\
    In the Localization MovieClip:
    var pbcBtnTips_ENU:Array = new Array("Rewind ",
              "Back ",
              "Play ",
              "Pause ",
              "Forward ",
              "Closed Captioning ",
              "Audio On ",
              "Audio Off ",
              "Exit ",
              "Information ",
              "dummy for scratch bar ",
              "Table of Contents ",
              "2x Fast Forward Speed ",
              "4x Fast Forward Speed ",
              "Normal Speed ",
              "Print");
    For HTML 5 you'll need to edit the playbarScript.js file:
    C:\Program Files\Adobe\Adobe Captivate 7 x64\Templates\PlaybackFLA\HTML\
    cp.playbarTooltips =
    AudioOff : 'Audio Off',
    AudioOn : 'Audio On',
    BackGround : 'BackGround',
    Backward : 'Backward',
    Color : 'Color',
    CC : 'CC',
    Exit : 'Exit',
    FastForward : '2x Fast Forward Speed',
    FastForward1 : '4x Fast Forward Speed',
    FastForward2 : 'Normal Speed',
    Forward : 'Forward',
    Glow : 'Glow',
    Height : 'Height',
    InnerStroke : 'InnerStroke',
    Play : 'Play',
    Pause : 'Pause',
    Progress : 'Progress',
    Rewind : 'Rewind',
    Shade : 'Shade',
    Stroke : 'Stroke',
    Thumb : 'Thumb',
    ThumbBase : 'ThumbBase',
    TOC : 'TOC'

  • How to change the column names in display

    Hi,
    I want to change the columns names and give the display names as more User friendly..
    How should I acheive this in WebI reports.
    Regards,
    BOB

    Hi,
    the columns names are normal text fields. Just selecdt to edit your report , go to the editor panel and select the column header you want to modify. You can enter the text you want to display
    Regards,
    Stratos

  • How to change the column name as bold in adf table

    Hi,
    How can I change the column name with bolder style and blue colour in adf Table?
    I changed the color and font weight in af:column properties, but its effecting the data in that column but not with the column Header Text property.(i have given column name in header text).
    can any one have any idea how to do this?
    and I have taken panel tabbed layout and in that i'm displaying this table.
    but this table has scroll beneath of it to show all columns.
    but i want to display all columns (for this, page should have scroll at the bottom side).
    how can I achieve this???

    Hi,
    Add the following CSS Code to the custom skin css file that is to be created as per the suggestions above.
    *af|column::column-header-cell{*
    color:Blue;
    font-weight:bold;
    This would ensure that all the table column headers are blue in color and bolder font style through-out the application.
    By the way, what version of JDeveloper are you using?
    Thanks,
    Navaneeth

  • How to change the header and footer in the Section Breaks Next Page using OpenXML?

    I have a word document file in which I added a Section Break of Next Page, now I want to change the header and footer of that page.
    Scenario of example, I have a doc file which has four pages with headers and footers and added fifth page in the section break next page, I want to change the header and footer of the fifth page only. This is achievable manually by deselecting the Link to Previous
    button in the Word Application but I don't know how to change it using XML?
    My code that adds the new page in the section breaks is:
    class Program
    static void Main(string[] args)
    string path = @"C:\Riyaz\sample.docx";
    string strtxt = "Hello This is done by programmatically";
    OpenAndAddTextToWordDocument(path,strtxt);
    public static void OpenAndAddTextToWordDocument(string filepath, string txt)
    using (DocX document = DocX.Load(@"C:\Riyaz\sample.docx"))
    document.InsertSectionPageBreak();
    Paragraph p1 = document.InsertParagraph();
    p1.Append("This is new section");
    document.Save();
    Please help.

    Here is the sample for your reference:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using DocumentFormat.OpenXml;
    using DocumentFormat.OpenXml.Packaging;
    using DocumentFormat.OpenXml.Wordprocessing;
    namespace WordAddNewFooterHeader
    class Program
    static void Main(string[] args)
    string path = @"E:\Document\TestHeaderandfooter-Copy.docx";
    string strtxt = "OpenXML SDK";
    OpenAndAddTextToWordDocument(path, strtxt);
    public static void OpenAndAddTextToWordDocument(string filepath, string txt)
    // Open a WordprocessingDocument for editing using the filepath.
    WordprocessingDocument wordprocessingDocument = WordprocessingDocument.Open(filepath, true);
    MainDocumentPart part = wordprocessingDocument.MainDocumentPart;
    Body body = part.Document.Body;
    //create a new footer Id=rIdf2
    FooterPart footerPart2 = part.AddNewPart<FooterPart>("rIdf2");
    GenerateFooterPartContent(footerPart2);
    //create a new header Id=rIdh2
    HeaderPart headerPart2 = part.AddNewPart<HeaderPart>("rIdh2");
    GenerateHeaderPartContent(headerPart2);
    //replace the attribute of SectionProperties to add new footer and header
    SectionProperties lxml = body.GetFirstChild<SectionProperties>();
    lxml.GetFirstChild<HeaderReference>().Remove();
    lxml.GetFirstChild<FooterReference>().Remove();
    HeaderReference headerReference1 = new HeaderReference() { Type = HeaderFooterValues.Default, Id = "rIdh2" };
    FooterReference footerReference1 = new FooterReference() { Type = HeaderFooterValues.Default, Id = "rIdf2" };
    lxml.Append(headerReference1);
    lxml.Append(footerReference1);
    //add the correlation of last Paragraph
    OpenXmlElement oxl = body.ChildElements.GetItem(body.ChildElements.Count - 2);
    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    SectionProperties sectionProperties1 = new SectionProperties() { RsidR = oxl.GetAttribute("rsidR", oxl.NamespaceUri).Value };
    HeaderReference headerReference2 = new HeaderReference() { Type = HeaderFooterValues.Default, Id = part.GetIdOfPart(part.HeaderParts.FirstOrDefault()) };
    FooterReference footerReference2 = new FooterReference() { Type = HeaderFooterValues.Default, Id = part.GetIdOfPart(part.FooterParts.FirstOrDefault()) };
    PageSize pageSize1 = new PageSize() { Width = (UInt32Value)12240U, Height = (UInt32Value)15840U };
    PageMargin pageMargin1 = new PageMargin() { Top = 1440, Right = (UInt32Value)1440U, Bottom = 1440, Left = (UInt32Value)1440U, Header = (UInt32Value)720U, Footer = (UInt32Value)720U, Gutter = (UInt32Value)0U };
    Columns columns1 = new Columns() { Space = "720" };
    DocGrid docGrid1 = new DocGrid() { LinePitch = 360 };
    sectionProperties1.Append(headerReference2);
    sectionProperties1.Append(footerReference2);
    sectionProperties1.Append(pageSize1);
    sectionProperties1.Append(pageMargin1);
    sectionProperties1.Append(columns1);
    sectionProperties1.Append(docGrid1);
    paragraphProperties1.Append(sectionProperties1);
    oxl.InsertAt<ParagraphProperties>(paragraphProperties1, 0);
    body.InsertBefore<Paragraph>(GenerateParagraph(txt, oxl.GetAttribute("rsidRDefault", oxl.NamespaceUri).Value), body.GetFirstChild<SectionProperties>());
    part.Document.Save();
    wordprocessingDocument.Close();
    //Generate new Paragraph
    public static Paragraph GenerateParagraph(string text, string rsidR)
    Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = rsidR };
    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    Tabs tabs1 = new Tabs();
    TabStop tabStop1 = new TabStop() { Val = TabStopValues.Left, Position = 5583 };
    tabs1.Append(tabStop1);
    paragraphProperties1.Append(tabs1);
    Run run1 = new Run();
    Text text1 = new Text();
    text1.Text = text;
    run1.Append(text1);
    Run run2 = new Run();
    TabChar tabChar1 = new TabChar();
    run2.Append(tabChar1);
    paragraph1.Append(paragraphProperties1);
    paragraph1.Append(run1);
    paragraph1.Append(run2);
    return paragraph1;
    static void GenerateHeaderPartContent(HeaderPart hpart)
    Header header1 = new Header();
    Paragraph paragraph1 = new Paragraph();
    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Header" };
    paragraphProperties1.Append(paragraphStyleId1);
    Run run1 = new Run();
    Text text1 = new Text();
    text1.Text = "";
    run1.Append(text1);
    paragraph1.Append(paragraphProperties1);
    paragraph1.Append(run1);
    header1.Append(paragraph1);
    hpart.Header = header1;
    static void GenerateFooterPartContent(FooterPart fpart)
    Footer footer1 = new Footer();
    Paragraph paragraph1 = new Paragraph();
    ParagraphProperties paragraphProperties1 = new ParagraphProperties();
    ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Footer" };
    paragraphProperties1.Append(paragraphStyleId1);
    Run run1 = new Run();
    Text text1 = new Text();
    text1.Text = "";
    run1.Append(text1);
    paragraph1.Append(paragraphProperties1);
    paragraph1.Append(run1);
    footer1.Append(paragraph1);
    fpart.Footer = footer1;
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to change the default name of new adjustment layers? (and other Q's)

    How do I change the default name of new adjustment layers?
    How can I make it so that adjustment layers don't come with a mask when I create them (unless I have a selection active)?
    Why isn't the Shadows/Highlights functionality an adjustment layer? It's accessable under "adjustments" but you can't use it non-destructive
    Where can I find documentation on Photoshop's API? (I want o make tools for it - javascript)

    Forgive me for not looking into your Maya-specific links, but one can automate Photoshop using JavaScript indeed (on Windows also VB, on Mac also AppleScript).
    Not everything can be automated naturally, but a lot – and it can really speed up many tasks; and with the »small« repetitive ones like saving copies off of files etc. combining Scripts with Configurator Panels can be especially convenient.
    There is a Scripting Forum over at
    http://forums.adobe.com/community/photoshop/photoshop_scripting
    As for plugins: it's something I would like to learn some day (I guess you would have to go with Flash and AS3 for making actual plugins)
    I think you might also have to learn C++ or C.
    There is Forum the contributors to which might be able to give you pointers if you get to that. 
    http://forums.adobe.com/community/photoshop/photoshop_sdk

Maybe you are looking for