zeus
4 years ago
15 changed files with 63 additions and 131 deletions
@ -1,11 +1,11 @@ |
|||||
|
|
||||
echo "Cutting Contents of a file on the standard output (stdout)." |
echo "Cutting Contents of a file on the standard output (stdout)." |
||||
echo "----------------------------------------------------------" |
echo "-------------------------------" |
||||
|
|
||||
cut -b1,3 $LLO_DATAFILE | head -5 |
cut -b1,3 $LLO_DATAFILE | head -5 |
||||
echo "" |
echo "" |
||||
|
|
||||
echo "Cutting Contents of a file on the standard output (stdout)." |
echo "Cutting Contents of a file on the standard output (stdout)." |
||||
echo "-------------------with ranges---------------------------------------" |
echo "-----with ranges-----" |
||||
|
|
||||
cut -b1-5,10-15 $LLO_DATAFILE | head -5 |
cut -b1-5,10-15 $LLO_DATAFILE | head -5 |
||||
|
@ -1,25 +0,0 @@ |
|||||
|
|
||||
echo 'Display tab characters as ^I' |
|
||||
echo "-------------------------------" |
|
||||
|
|
||||
cat -T $LLO_DATAFILE | head -9 |
|
||||
echo "" |
|
||||
|
|
||||
echo "Display non printing characters" |
|
||||
echo "-------------------------------" |
|
||||
|
|
||||
cat -v $LLO_DATAFILE | head -9 |
|
||||
echo "" |
|
||||
|
|
||||
echo "Suppress repeated empty lines" |
|
||||
echo "-------------------------------" |
|
||||
|
|
||||
cat -s $LLO_DATAFILE | head -9 |
|
||||
echo "" |
|
||||
|
|
||||
echo "In case, you need to use the -v, -E and -T option together, you can just use the -A command line option." |
|
||||
echo "-------------------------------" |
|
||||
|
|
||||
cat -A $LLO_DATAFILE | head -9 |
|
||||
echo "" |
|
||||
|
|
@ -1,4 +0,0 @@ |
|||||
tmpfile=$(mktemp /tmp/test1.XXXXXX) |
|
||||
cat -A $LLO_DATAFILE | head -5 > $tmpfile |
|
||||
cat $tmpfile |
|
||||
|
|
@ -1,8 +0,0 @@ |
|||||
Use *mktemp* to create a temporary file in _/tmp_ |
|
||||
|
|
||||
run |
|
||||
|
|
||||
[source,bash] |
|
||||
---- |
|
||||
mktemp --help |
|
||||
---- |
|
@ -1,62 +0,0 @@ |
|||||
The cat command also allows |
|
||||
|
|
||||
- Display tab characters as ^I |
|
||||
|
|
||||
[source,bash] |
|
||||
---- |
|
||||
display tab characters as ^I |
|
||||
---- |
|
||||
|
|
||||
For example: |
|
||||
|
|
||||
[source,bash] |
|
||||
---- |
|
||||
cat -T $LLO_DATAFILE | head -9 |
|
||||
---- |
|
||||
|
|
||||
|
|
||||
- Display non printing characters |
|
||||
|
|
||||
For example: |
|
||||
|
|
||||
[source,bash] |
|
||||
---- |
|
||||
cat -v $LLO_DATAFILE | head -9 |
|
||||
---- |
|
||||
|
|
||||
- Suppress repeated empty lines |
|
||||
|
|
||||
For example: |
|
||||
|
|
||||
[source,bash] |
|
||||
---- |
|
||||
cat -s $LLO_DATAFILE | head -9 |
|
||||
---- |
|
||||
|
|
||||
[INFO] |
|
||||
==== |
|
||||
In case, you need to use the -v, -E and -T option together, you can just use the -A command line option. |
|
||||
==== |
|
||||
|
|
||||
For example: |
|
||||
|
|
||||
[source,bash] |
|
||||
---- |
|
||||
cat -A $LLO_DATAFILE | head -9 |
|
||||
---- |
|
||||
|
|
||||
[INFO] |
|
||||
==== |
|
||||
|
|
||||
DATAFILE |
|
||||
|
|
||||
The datafile contains aggregate individual statistics for 67 NBA seasons. from basic box-score attributes such as points, assists, rebounds etc., to more advanced money-ball like features such as Value Over Replacement. |
|
||||
|
|
||||
Take a look in |
|
||||
link:https://git.swarmlab.io:3000/llo/LabLearningObject/src/branch/master/data/nba_statistics_glossary[Glossary^] |
|
||||
for a detailed column description |
|
||||
|
|
||||
ENVIRONMENT VARIABLE: LLO_DATAFILE |
|
||||
|
|
||||
==== |
|
||||
|
|
@ -1,8 +0,0 @@ |
|||||
|
|
||||
Create a temporary file and put output with |
|
||||
|
|
||||
[source,sh] |
|
||||
---- |
|
||||
cat -A $LLO_DATAFILE | head -5 > ... |
|
||||
---- |
|
||||
|
|
@ -0,0 +1,5 @@ |
|||||
|
|
||||
|
echo "Cutting Contents of a file on the standard output (stdout)." |
||||
|
echo "-----with ranges-----" |
||||
|
|
||||
|
cut -c1-5,10-15 $LLO_DATAFILE | head -5 |
@ -0,0 +1 @@ |
|||||
|
grep "Jordan" $LLO_DATAFILE | cut -c 8- | head -5 |
@ -0,0 +1,2 @@ |
|||||
|
|
||||
|
-b It uses a special form: selecting bytes upto the end of the line |
@ -0,0 +1,26 @@ |
|||||
|
|
||||
|
*-c(column):* To extract the specific character. |
||||
|
|
||||
|
This can be a list of numbers separated comma or a range of numbers separated by hyphen(-) |
||||
|
|
||||
|
[source,bash] |
||||
|
---- |
||||
|
cut -c 1-5 $LLO_DATAFILE | head -5 |
||||
|
---- |
||||
|
|
||||
|
|
||||
|
[INFO] |
||||
|
==== |
||||
|
|
||||
|
DATAFILE |
||||
|
|
||||
|
The datafile contains aggregate individual statistics for 67 NBA seasons. from basic box-score attributes such as points, assists, rebounds etc., to more advanced money-ball like features such as Value Over Replacement. |
||||
|
|
||||
|
Take a look in |
||||
|
link:https://git.swarmlab.io:3000/llo/LabLearningObject/src/branch/master/data/nba_statistics_glossary[Glossary^] |
||||
|
for a detailed column description |
||||
|
|
||||
|
ENVIRONMENT VARIABLE: LLO_DATAFILE |
||||
|
|
||||
|
==== |
||||
|
|
@ -0,0 +1,9 @@ |
|||||
|
|
||||
|
Try to run |
||||
|
|
||||
|
[source,sh] |
||||
|
---- |
||||
|
cut -c 3- $LLO_DATAFILE | head -5 |
||||
|
---- |
||||
|
|
||||
|
and see the Results! |
Loading…
Reference in new issue