Filter Require Capital words from a file( not all capital words )
Clash Royale CLAN TAG#URR8PPP
I want Output of this file only
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Here is my input:
6.1.2 Power and Ground Pins
The following table describes the power and ground pins for the PLL.
Table 5: Power and Ground Pins
Pin Name Description
Analog power pin. This pin provides the power supply for the sensitive analog
AVDDPLL1V8
blocks of the PLL.
Analog ground pin. This pin provides the ground for the sensitive analog blocks
AGNDPLL1V8
of the PLL.
Digital power pin. This pin provides power supply for the digital circuits in the
DVDDPLL1V1
PLL.
DGNDPLL1V1 Digital ground pin. This pin provides ground for the digital circuits in the PLL.
text-processing
add a comment |
I want Output of this file only
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Here is my input:
6.1.2 Power and Ground Pins
The following table describes the power and ground pins for the PLL.
Table 5: Power and Ground Pins
Pin Name Description
Analog power pin. This pin provides the power supply for the sensitive analog
AVDDPLL1V8
blocks of the PLL.
Analog ground pin. This pin provides the ground for the sensitive analog blocks
AGNDPLL1V8
of the PLL.
Digital power pin. This pin provides power supply for the digital circuits in the
DVDDPLL1V1
PLL.
DGNDPLL1V1 Digital ground pin. This pin provides ground for the digital circuits in the PLL.
text-processing
Thanks for answers. Some times I may have VSSA or VDDA also instead of DVDDPLL1V1 in file. At that time suggitions given by you will not work. It is ouput of table pinname and decription in a pdf (we did pdf2text converter). Required names are always under Pin Name. In PDF pin names and description are always varies. But table size will not varie. Can you get by using theese inputs?????? Thanks in advance, Venu
– user82398
Aug 29 '14 at 11:45
add a comment |
I want Output of this file only
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Here is my input:
6.1.2 Power and Ground Pins
The following table describes the power and ground pins for the PLL.
Table 5: Power and Ground Pins
Pin Name Description
Analog power pin. This pin provides the power supply for the sensitive analog
AVDDPLL1V8
blocks of the PLL.
Analog ground pin. This pin provides the ground for the sensitive analog blocks
AGNDPLL1V8
of the PLL.
Digital power pin. This pin provides power supply for the digital circuits in the
DVDDPLL1V1
PLL.
DGNDPLL1V1 Digital ground pin. This pin provides ground for the digital circuits in the PLL.
text-processing
I want Output of this file only
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Here is my input:
6.1.2 Power and Ground Pins
The following table describes the power and ground pins for the PLL.
Table 5: Power and Ground Pins
Pin Name Description
Analog power pin. This pin provides the power supply for the sensitive analog
AVDDPLL1V8
blocks of the PLL.
Analog ground pin. This pin provides the ground for the sensitive analog blocks
AGNDPLL1V8
of the PLL.
Digital power pin. This pin provides power supply for the digital circuits in the
DVDDPLL1V1
PLL.
DGNDPLL1V1 Digital ground pin. This pin provides ground for the digital circuits in the PLL.
text-processing
text-processing
edited Jan 26 at 16:07
Rui F Ribeiro
40.1k1479136
40.1k1479136
asked Aug 29 '14 at 8:33
yishayisha
2514714
2514714
Thanks for answers. Some times I may have VSSA or VDDA also instead of DVDDPLL1V1 in file. At that time suggitions given by you will not work. It is ouput of table pinname and decription in a pdf (we did pdf2text converter). Required names are always under Pin Name. In PDF pin names and description are always varies. But table size will not varie. Can you get by using theese inputs?????? Thanks in advance, Venu
– user82398
Aug 29 '14 at 11:45
add a comment |
Thanks for answers. Some times I may have VSSA or VDDA also instead of DVDDPLL1V1 in file. At that time suggitions given by you will not work. It is ouput of table pinname and decription in a pdf (we did pdf2text converter). Required names are always under Pin Name. In PDF pin names and description are always varies. But table size will not varie. Can you get by using theese inputs?????? Thanks in advance, Venu
– user82398
Aug 29 '14 at 11:45
Thanks for answers. Some times I may have VSSA or VDDA also instead of DVDDPLL1V1 in file. At that time suggitions given by you will not work. It is ouput of table pinname and decription in a pdf (we did pdf2text converter). Required names are always under Pin Name. In PDF pin names and description are always varies. But table size will not varie. Can you get by using theese inputs?????? Thanks in advance, Venu
– user82398
Aug 29 '14 at 11:45
Thanks for answers. Some times I may have VSSA or VDDA also instead of DVDDPLL1V1 in file. At that time suggitions given by you will not work. It is ouput of table pinname and decription in a pdf (we did pdf2text converter). Required names are always under Pin Name. In PDF pin names and description are always varies. But table size will not varie. Can you get by using theese inputs?????? Thanks in advance, Venu
– user82398
Aug 29 '14 at 11:45
add a comment |
4 Answers
4
active
oldest
votes
sed -n 's/^ *([[:upper:]0-9]10,).*/1/p'
That will print the first word on a line if the word is comprised of at least 10 consecutive characters that are only uppercase letters and/or numbers. Nothing else is printed.
Run on your example data its output is:
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
add a comment |
One way to do it:
$ awk '$1 ~ /^[[:upper:]]+[0-9]+/ print $1' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Explanation
We only check first field of each line, if it start with ^
one or more uppercase characters [[:upper:]]+
, follow by one or more numbers [0-9]+
, just print it.
With your input, I assume that after uppercase characters is one ore more numbers.
add a comment |
Try the below grep command to print all the alphanumeric characters,
$ grep -oP '[A-Z0-9]*[A-Z][0-9][A-Z0-9]*' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
add a comment |
If your problem with the existing answers is
that they don’t find words that consist only of capital letters (with no digits),
then we can adapt Gnouc’s answer like this:
awk '$1 ~ /^[[:upper:]0-9]+$/ print $1'
or
awk '$1 ~ /^[[:upper:][:digit:]]+$/ print $1'
This differs from his solution in that
- By putting the digits (
[0-9]
or[:digit:]
) into the brackets
with the capital letters ([:upper:]
), we require only that each matching character
is either a capital letter or a digit,
where Gnouc’s current answer requires at least one of each. - By adding the
$
, we make sure that the entire first word
is composed of capital letters and/or digits.
Without it,The
,Table
,Pin
, andAnalog
would match
because they begin with a capital letter.
This would match a plain number (e.g., 612
)
if it is the first “word” (i.e., the first sequence of non-blank characters) on a line.
To avoid this, do
awk '$1 ~ /^[[:upper:]][[:upper:]0-9]*$/ print $1'
or
awk '$1 ~ /^[[:upper:]][[:upper:][:digit:]]*$/ print $1'
which require the “word” to begin with a letter.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f152743%2ffilter-require-capital-words-from-a-file-not-all-capital-words%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
sed -n 's/^ *([[:upper:]0-9]10,).*/1/p'
That will print the first word on a line if the word is comprised of at least 10 consecutive characters that are only uppercase letters and/or numbers. Nothing else is printed.
Run on your example data its output is:
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
add a comment |
sed -n 's/^ *([[:upper:]0-9]10,).*/1/p'
That will print the first word on a line if the word is comprised of at least 10 consecutive characters that are only uppercase letters and/or numbers. Nothing else is printed.
Run on your example data its output is:
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
add a comment |
sed -n 's/^ *([[:upper:]0-9]10,).*/1/p'
That will print the first word on a line if the word is comprised of at least 10 consecutive characters that are only uppercase letters and/or numbers. Nothing else is printed.
Run on your example data its output is:
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
sed -n 's/^ *([[:upper:]0-9]10,).*/1/p'
That will print the first word on a line if the word is comprised of at least 10 consecutive characters that are only uppercase letters and/or numbers. Nothing else is printed.
Run on your example data its output is:
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
answered Aug 29 '14 at 20:50
mikeservmikeserv
45.6k668158
45.6k668158
add a comment |
add a comment |
One way to do it:
$ awk '$1 ~ /^[[:upper:]]+[0-9]+/ print $1' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Explanation
We only check first field of each line, if it start with ^
one or more uppercase characters [[:upper:]]+
, follow by one or more numbers [0-9]+
, just print it.
With your input, I assume that after uppercase characters is one ore more numbers.
add a comment |
One way to do it:
$ awk '$1 ~ /^[[:upper:]]+[0-9]+/ print $1' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Explanation
We only check first field of each line, if it start with ^
one or more uppercase characters [[:upper:]]+
, follow by one or more numbers [0-9]+
, just print it.
With your input, I assume that after uppercase characters is one ore more numbers.
add a comment |
One way to do it:
$ awk '$1 ~ /^[[:upper:]]+[0-9]+/ print $1' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Explanation
We only check first field of each line, if it start with ^
one or more uppercase characters [[:upper:]]+
, follow by one or more numbers [0-9]+
, just print it.
With your input, I assume that after uppercase characters is one ore more numbers.
One way to do it:
$ awk '$1 ~ /^[[:upper:]]+[0-9]+/ print $1' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Explanation
We only check first field of each line, if it start with ^
one or more uppercase characters [[:upper:]]+
, follow by one or more numbers [0-9]+
, just print it.
With your input, I assume that after uppercase characters is one ore more numbers.
edited Aug 29 '14 at 8:57
answered Aug 29 '14 at 8:39
cuonglmcuonglm
104k24204302
104k24204302
add a comment |
add a comment |
Try the below grep command to print all the alphanumeric characters,
$ grep -oP '[A-Z0-9]*[A-Z][0-9][A-Z0-9]*' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
add a comment |
Try the below grep command to print all the alphanumeric characters,
$ grep -oP '[A-Z0-9]*[A-Z][0-9][A-Z0-9]*' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
add a comment |
Try the below grep command to print all the alphanumeric characters,
$ grep -oP '[A-Z0-9]*[A-Z][0-9][A-Z0-9]*' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
Try the below grep command to print all the alphanumeric characters,
$ grep -oP '[A-Z0-9]*[A-Z][0-9][A-Z0-9]*' file
AVDDPLL1V8
AGNDPLL1V8
DVDDPLL1V1
DGNDPLL1V1
edited Aug 29 '14 at 10:34
answered Aug 29 '14 at 10:04
Avinash RajAvinash Raj
2,60731227
2,60731227
add a comment |
add a comment |
If your problem with the existing answers is
that they don’t find words that consist only of capital letters (with no digits),
then we can adapt Gnouc’s answer like this:
awk '$1 ~ /^[[:upper:]0-9]+$/ print $1'
or
awk '$1 ~ /^[[:upper:][:digit:]]+$/ print $1'
This differs from his solution in that
- By putting the digits (
[0-9]
or[:digit:]
) into the brackets
with the capital letters ([:upper:]
), we require only that each matching character
is either a capital letter or a digit,
where Gnouc’s current answer requires at least one of each. - By adding the
$
, we make sure that the entire first word
is composed of capital letters and/or digits.
Without it,The
,Table
,Pin
, andAnalog
would match
because they begin with a capital letter.
This would match a plain number (e.g., 612
)
if it is the first “word” (i.e., the first sequence of non-blank characters) on a line.
To avoid this, do
awk '$1 ~ /^[[:upper:]][[:upper:]0-9]*$/ print $1'
or
awk '$1 ~ /^[[:upper:]][[:upper:][:digit:]]*$/ print $1'
which require the “word” to begin with a letter.
add a comment |
If your problem with the existing answers is
that they don’t find words that consist only of capital letters (with no digits),
then we can adapt Gnouc’s answer like this:
awk '$1 ~ /^[[:upper:]0-9]+$/ print $1'
or
awk '$1 ~ /^[[:upper:][:digit:]]+$/ print $1'
This differs from his solution in that
- By putting the digits (
[0-9]
or[:digit:]
) into the brackets
with the capital letters ([:upper:]
), we require only that each matching character
is either a capital letter or a digit,
where Gnouc’s current answer requires at least one of each. - By adding the
$
, we make sure that the entire first word
is composed of capital letters and/or digits.
Without it,The
,Table
,Pin
, andAnalog
would match
because they begin with a capital letter.
This would match a plain number (e.g., 612
)
if it is the first “word” (i.e., the first sequence of non-blank characters) on a line.
To avoid this, do
awk '$1 ~ /^[[:upper:]][[:upper:]0-9]*$/ print $1'
or
awk '$1 ~ /^[[:upper:]][[:upper:][:digit:]]*$/ print $1'
which require the “word” to begin with a letter.
add a comment |
If your problem with the existing answers is
that they don’t find words that consist only of capital letters (with no digits),
then we can adapt Gnouc’s answer like this:
awk '$1 ~ /^[[:upper:]0-9]+$/ print $1'
or
awk '$1 ~ /^[[:upper:][:digit:]]+$/ print $1'
This differs from his solution in that
- By putting the digits (
[0-9]
or[:digit:]
) into the brackets
with the capital letters ([:upper:]
), we require only that each matching character
is either a capital letter or a digit,
where Gnouc’s current answer requires at least one of each. - By adding the
$
, we make sure that the entire first word
is composed of capital letters and/or digits.
Without it,The
,Table
,Pin
, andAnalog
would match
because they begin with a capital letter.
This would match a plain number (e.g., 612
)
if it is the first “word” (i.e., the first sequence of non-blank characters) on a line.
To avoid this, do
awk '$1 ~ /^[[:upper:]][[:upper:]0-9]*$/ print $1'
or
awk '$1 ~ /^[[:upper:]][[:upper:][:digit:]]*$/ print $1'
which require the “word” to begin with a letter.
If your problem with the existing answers is
that they don’t find words that consist only of capital letters (with no digits),
then we can adapt Gnouc’s answer like this:
awk '$1 ~ /^[[:upper:]0-9]+$/ print $1'
or
awk '$1 ~ /^[[:upper:][:digit:]]+$/ print $1'
This differs from his solution in that
- By putting the digits (
[0-9]
or[:digit:]
) into the brackets
with the capital letters ([:upper:]
), we require only that each matching character
is either a capital letter or a digit,
where Gnouc’s current answer requires at least one of each. - By adding the
$
, we make sure that the entire first word
is composed of capital letters and/or digits.
Without it,The
,Table
,Pin
, andAnalog
would match
because they begin with a capital letter.
This would match a plain number (e.g., 612
)
if it is the first “word” (i.e., the first sequence of non-blank characters) on a line.
To avoid this, do
awk '$1 ~ /^[[:upper:]][[:upper:]0-9]*$/ print $1'
or
awk '$1 ~ /^[[:upper:]][[:upper:][:digit:]]*$/ print $1'
which require the “word” to begin with a letter.
answered Aug 29 '14 at 15:10
G-ManG-Man
13.1k93465
13.1k93465
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f152743%2ffilter-require-capital-words-from-a-file-not-all-capital-words%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Thanks for answers. Some times I may have VSSA or VDDA also instead of DVDDPLL1V1 in file. At that time suggitions given by you will not work. It is ouput of table pinname and decription in a pdf (we did pdf2text converter). Required names are always under Pin Name. In PDF pin names and description are always varies. But table size will not varie. Can you get by using theese inputs?????? Thanks in advance, Venu
– user82398
Aug 29 '14 at 11:45