How to use text editors for text data munging

While I am great fond of both worlds (Windows and Unix) Shell scripting, as a PC end user I find it easier to work with some of the text editors to get rid of building the shell scripting syntaxes every time.

 

Here I ‘d like to share some cool ways which helps you achieve very common data munging tasks without you involving to write/understand any complex script/code lines.

 

Line Operations:

Prefix and/or Append a given text to each line in a file

Use Notepad2.exe > Edit > Block > “Modify Lines…” In the dialog box enter the text you’d like to have prefixed and/or appended to each line of the file as shown below

image

When you click ok, the lines will now have the newly prefixed and/or appended text as shown below:

image

 

Replace the last or first character of each line in a file:

To replace the last character in each line of text:  use the same notepad2.exe and Replace Text option (Ctrl+H), 

image

After Replacing all you’ll the lines as below with new character/text added to each line

image

 

image

 

image

Leave a Reply

Your email address will not be published. Required fields are marked *