How to Add Comma at the End of Each Line ?

Опубликовано: 18 Июнь 2020
на канале: Mr. Virk Media
15,034
35

In this Video, we will go through the steps required to Add Comma at the End of Each Line. Article: https://mrvirk.com/how-to-add-comma-a...

The same steps can be used in both Mac or Windows using any of the commonly used code editors.

This tutorial covers 3 different editors for diversity so there is something for everyone, they are -
1- Atom
2- Sublime Text
3- Visual Studio Code

You may even use the solution to remove a comma or even better add or remove other character or words after each line.

Welcome to to Mr. Virk Media, I am your host Navjot Virk. And will be walking you through the steps.

Use case: I have an excel dataset that contains public companies info like ticker symbol, industry etc.

But, I am interested in created an online portfolio on say Yahoo Finance which requires comma separated ticker symbols for multiple entries, and off-course I am not interested in inserting data individually (maybe I am lazy or want to save time & energy or their maybe just too much data to work with, any the case I think their is no point going one by one if you can do it all at once and more effectively).

Sample Data (you can use this for practice or testing)
MMM,
ABM,
MO,
AWR,
CWT,
CINF,
KO,
CL,
CBSH,

Data is just a bunch of ticker symbols of publicly traded companies


Steps
Note: If you are on a Windows Computer please use Ctrl (control) button on your keyboard instead of Command and you should be able to achieve the same results.

Let’s start, open your code editor with data you would like to work with, below, I have have isolated all the ticker symbols I am interested in working with.

Step 1: Select all the data using Command + A on your keyboard
Command + A to Select all text in Mac

Step 2: Press Command + Shift + L to split data into lines, this will allow you to work at the end of each line.

How to split data into lines ?
Step 3: Using the Arrow key → navigate to end of the line, and add comma or any other content of your choice.

Add Comma or Something at the Start of Each Line

Now if you had use-case where you wanted to add comma at the start of each line, you would just want to simply navigate to start of line using the ← symbol on the keyboard