Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

cut powershell

Get-Content $filename | ForEach-Object {
    $_.split(":")
}
Comment

cut command in powershell windows

function cut {
  param(
    [Parameter(ValueFromPipeline=$True)] [string]$inputobject,
    [string]$delimiter='s+',
    [string[]]$field
  )

  process {
    if ($field -eq $null) { $inputobject -split $delimiter } else {
      ($inputobject -split $delimiter)[$field] }
  }
}


PS C:> 'hi:there' | cut -f 0 -d :
hi

PS C:> 'hi:there' | cut -f 1 -d :
there

PS C:> 'hi:there' | cut -f 0,1 -d :
hi
there

PS C:> 'hi:::there' | cut -f 0 -d :+
hi

PS C:> 'hi   there' | cut
hi
there
Comment

PREVIOUS NEXT
Code Example
Shell :: how to run "npm start" ansible pm2 
Shell :: dos2unix not found in mac 
Shell :: git stash in file 
Shell :: how to move file from one directory to another in linux 
Shell :: command can be used to find files or folders matching a particular search pattern in linux 
Shell :: install kex in kali linux wsl 
Shell :: dos2unix 
Shell :: ubuntu drivers realtek 
Shell :: My first git commit 
Shell :: how to open a .sh file 
Shell :: magento install with composer 
Shell :: cli50 installation 
Shell :: delete list of packages linux 
Shell :: terminal rename folder 
Shell :: linux zip file without parent directory 
Shell :: sharepoint logs folder 
Shell :: sed substitute a word in a file by the content in another file 
Shell :: run command every hour linux 
Shell :: pull from other branch 
Shell :: git alias variables 
Shell :: delete a branch in git command 
Shell :: ssh config only key 
Shell :: how to compile a python prohram that uses PyQt 
Shell :: create a branch from old commit 
Shell :: diskpart 
Shell :: check difference between two branches git 
Shell :: rmdir multiple directories 
Shell :: terminal open vim 
Shell :: install node_modules folder 
Shell :: docker remove 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =