retrieve only first line of data in csv

Welcome Forums General PowerShell Q&A retrieve only first line of data in csv

Viewing 2 reply threads
  • Author
    Posts
    • #49555
      Participant
      Topics: 23
      Replies: 160
      Points: 438
      Helping Hand
      Rank: Contributor

      silly question i know, but can't seem to get anything to easily work.

      I need to extract the first line of data from a csv file. the files will have many entries, but i only need the first line to calculate some other values for further processing.

    • #49559
      Keymaster
      Topics: 13
      Replies: 4872
      Points: 1,844
      Helping HandTeam Member
      Rank: Community Hero

      Import-CSV whatever.csv | Select -First 1

    • #49561
      Participant
      Topics: 23
      Replies: 160
      Points: 438
      Helping Hand
      Rank: Contributor

      wow, you rock Don, i'd seen it used in get-content, for some reason didn't even think to try with import-csv

Viewing 2 reply threads
  • The topic ‘retrieve only first line of data in csv’ is closed to new replies.