Import-csv SubString in the pipeline

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 2 years, 3 months ago.

  • Author
    Posts
  • #18398
    Profile photo of H Man
    H Man
    Participant

    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
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Thanks for posting the answer 😉

You must be logged in to reply to this topic.