Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

consider this as a sample of a text file:


How can I delete all the initial "|"characters and not the end ones? (I do this kind of jobs mostly through scripting)

Or consider this:||33.13.61|

How can I split these lines into two lines based on "|" position?

share|improve this question
What operating system are you on? Is there anything you've tried yet which didn't work for you? – slhck Mar 25 '13 at 21:31
Deleting the initial | can be done with beginning of line ^ selection. – Hennes Mar 25 '13 at 21:32
up vote 1 down vote accepted

If you are using Windows then it can be done with PowerShell, see example below

$string = "one two three four"
$string.split(" ")


Good thing is if you are using Windows 7 or above you already have it available.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.