locked
Unable to pull properties in CSV RRS feed

  • General discussion

  • Hi ,

    I have two properties in CSv Name and office

    I have assigned a variable by importing CSV file like below

    $users = import-csv "c:\temp" 

    When i do $user i can able to see two properties like below

    Name,office
    -----------
    CRJP-Nakano-13F-naveen-10,HND2

    But if i do $user.Name, i was unable to get name property only. Could you please suggest.



    Naveen Kumar

    Monday, August 26, 2019 7:47 AM

All replies

  • Please format your code as code using the code posting tool provided on the icon bar of the post editor (second to last icon). Thanks.

    If you import a csv you should specify a particular file - not just the folder. And you may specify the delimiter like ',' to make sure you split the properties on the correct charachter.


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    Monday, August 26, 2019 8:51 AM
  • Hi Naveen.

    There's an error in your code: you're trying to import a folder, the name of the .CSV file is not specified.
    I presume you're using a loop to get the value of each item in the .CSV file: could you post the code you're using to parse that .CSV file as well as a short sample of the file itself?

    Bye.


    Luigi Bruno
    MCP, MOS, MTA, MCTS, MCSA, MCSE

    Monday, August 26, 2019 11:21 AM
  • Please show us your CSV file.   Also, your culture setting may have made some character other than comma be your delimitor.  use

        -delimitor ,

    if this is the case to make sure that Name,Office isn't being treated as one field.  

    Monday, August 26, 2019 1:45 PM
  • Let me explain clearly now.

    I have 200 conference rooms accounts which doesn't have office details. I want to push them from CSV. below pushing all. i like try with two rooms fist. 

    Could you please provide the script update.


    Naveen Kumar

    Tuesday, August 27, 2019 7:11 PM
  • We do not write scripts for you.  Start by learning basic PowerShell then write your script.  If you have issues at that time then post your question with a full error.

    For how to use a CmdLet use "help"

    help import-csv -online

    This forum does not have the resources to give you personal training in basic PowerShell.


    \_(ツ)_/

    Tuesday, August 27, 2019 7:20 PM