Import-csv SubString in the pipeline

Welcome Forums General PowerShell Q&A Import-csv SubString in the pipeline

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
4 years, 3 months ago.

  • Author
    Posts
  • #18398

    Participant
    Points: 0
    Rank: Member

    I am using import-Csv which is returning 1 field(column) of file paths. These paths are long and all start with a phone #. I would like to when i am importing the csv file to parse just the phone # out of the string and save it to a $variable

    heres what it looks like

    
    $names = ipcsv "C:\Users\Administrator\Desktop\qa.csv" 
    
    9176727356 by rtoussaint@edu.com @ 11_16_28 AM.wav               
    3057412828 by ateed@edu.com @ 10_25_07 AM.wav                    
    5618959714 by wedden@edu.com @ 2_57_49 PM.wav  
    
    
    i solved it thanks 
    
    $names  | foreach {$_.name.Substring(0,10)}
    
    
    
    
  • #18425

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    Thanks for posting the answer 😉

The topic ‘Import-csv SubString in the pipeline’ is closed to new replies.