Head and tail are used to print n top or bottom lines respectively.
cat /usr/share/dict/words | head -360 | tail -15
Replacing or removing specific characters from the input.
Input:
School Phone Happy Valley Elementary School 814-555-1212 Happy Valley High School 814-555-1212 Happy Valley Middle School 814-555-1212 Happy Valley School District 814-555-1212
cat data.csv | tr '[a-z][A-Z]' '[A-Z][a-z]'
Output:
sCHOOL pHONE hAPPY vALLEY eLEMENTARY sCHOOL 814-555-1212 hAPPY vALLEY hIGH sCHOOL 814-555-1212 hAPPY vALLEY mIDDLE sCHOOL 814-555-1212 hAPPY vALLEY sCHOOL dISTRICT 814-555-1212
cat data.csv | tr '[0-9]' 'x'
Output:
School Phone Happy Valley Elementary School xxx-xxx-xxxx Happy Valley High School xxx-xxx-xxxx Happy Valley Middle School xxx-xxx-xxxx Happy Valley School District xxx-xxx-xxxx
cat data.csv | tr -s '[0-9A-Za-z]'
Output:
Schol Phone Hapy Valey Elementary Schol 814-5-1212 Hapy Valey High Schol 814-5-1212 Hapy Valey Midle Schol 814-5-1212 Hapy Valey Schol District 814-5-1212
cat data.csv | tr -d '[0-9]'
Output:
School Phone Happy Valley Elementary School -- Happy Valley High School -- Happy Valley Middle School -- Happy Valley School District --
Problem | Score | Companies | Time | Status |
---|---|---|---|---|
Valid phone number | 150 |
|
22:24 | |
Lines in a given range | 200 |
|
27:49 | |
Remove Punctuations | 250 |
|
12:58 | |
Transform CSV | 300 |
|
19:07 |