Sublime Editor rocks when it comes to handling Text files on any Operating systems you work on. You can make changes to text files much effectively using this tool. As a programmer there are times when i want to add certain text at the start and end of each line in a text file (like adding single or double quotes at both ends of each line)
Steps :- Open the file using Sublime Text.
- Press Ctrl + F Key on Windows / Command + F on Mac OS X.
- Now you would see Find Options at the bottom, Select .* (Regular Expression) Button
- Now Search : ^ (Exponent Symbol) and Click on Find all: You would see the cursor's blinking at the start of each line of the file, anything you type now will added at the start of each line.
- Similarly to add some text at the end of each line, Search : $ (Dollar)
- Thats it!
Note: Do check that the Regular expression option has been selected, if it is not you will not be able to perform this operation.
Example: Here is a file with some text, double quotes are to be added at the start and end of each line, below is a .gif image demonstration of how to achieve this using the above steps.
More Posts related to Sublime,
More Posts:
- [Fix] Microsoft teams error code 503 - Failed to reach https - Teams
- Running Android Lint has encountered a problem NullPointerException Error - Android
- Fix: zsh: command not found: adb (Android) - MacOS
- fix fatal: --local can only be used inside a git repository error - Git
- How to Get List of All Country Codes in Java Using Locale Class - Java
- PowerShell: How to Get Folder Size - Powershell
- How to install Apache Maven on Ubuntu - Ubuntu
- How to Execute cURL Command from Python Code - Python