Unix script to compare 3rd column value with first column and display [on hold]How can I compare two files based on the value of the first column?Shell Script to remove double quotes within the column valueunix: replace one entire column in one file with a single value from another fileMerging 2 files and keeping the one duplicateHow to compare 2 files with common columns and then get the output file with columns from each fileCompare two columns and insert value to next columncomparing 1st and 3rd column value in two filesCount by first column, count distinct by second column and group output by first column?compare column of two files and print data accordinglyawk command prints first column value as 1
Does the radius of the Spirit Guardians spell depend on the size of the caster?
Non-Jewish family in an Orthodox Jewish Wedding
"which" command doesn't work / path of Safari?
least quadratic residue under GRH: an EXPLICIT bound
What is the offset in a seaplane's hull?
What is the meaning of "of trouble" in the following sentence?
What is GPS' 19 year rollover and does it present a cybersecurity issue?
Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?
Prevent a directory in /tmp from being deleted
Finding files for which a command fails
Copycat chess is back
Should I join an office cleaning event for free?
What would happen to a modern skyscraper if it rains micro blackholes?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
How is the relation "the smallest element is the same" reflexive?
Are white and non-white police officers equally likely to kill black suspects?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
how to create a data type and make it available in all Databases?
Can a German sentence have two subjects?
XeLaTeX and pdfLaTeX ignore hyphenation
Can I make popcorn with any corn?
Is there a familial term for apples and pears?
Simulate Bitwise Cyclic Tag
Patience, young "Padovan"
Unix script to compare 3rd column value with first column and display [on hold]
How can I compare two files based on the value of the first column?Shell Script to remove double quotes within the column valueunix: replace one entire column in one file with a single value from another fileMerging 2 files and keeping the one duplicateHow to compare 2 files with common columns and then get the output file with columns from each fileCompare two columns and insert value to next columncomparing 1st and 3rd column value in two filesCount by first column, count distinct by second column and group output by first column?compare column of two files and print data accordinglyawk command prints first column value as 1
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
My source data (INput) is like below
EPIC1 router EPIC2 Targetdefinition
Exp1 Expres rtr1 Router
SQL SrcQual Exp1 Expres
rtr1 Router EPIC1 Targetdefinition
My output like
SQL SrcQual Exp1 Expres
Exp1 Expres rtr1 Router
rtr1 Router EPIC1 Targetdefinition
EPIC1 router EPIC2 Targetdefinition
I need to write a Unix script to search 3rd column value in 1st column and display the records in sorted order like above output.
text-processing awk sed
New contributor
put on hold as off-topic by Rui F Ribeiro, Sparhawk, αғsнιη, Haxiel, Prvt_Yadv yesterday
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
add a comment |
My source data (INput) is like below
EPIC1 router EPIC2 Targetdefinition
Exp1 Expres rtr1 Router
SQL SrcQual Exp1 Expres
rtr1 Router EPIC1 Targetdefinition
My output like
SQL SrcQual Exp1 Expres
Exp1 Expres rtr1 Router
rtr1 Router EPIC1 Targetdefinition
EPIC1 router EPIC2 Targetdefinition
I need to write a Unix script to search 3rd column value in 1st column and display the records in sorted order like above output.
text-processing awk sed
New contributor
put on hold as off-topic by Rui F Ribeiro, Sparhawk, αғsнιη, Haxiel, Prvt_Yadv yesterday
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
2
Please show us what have you tried to do and where you need Unix enlightenment
– Rui F Ribeiro
2 days ago
3
Someone might help you, but we're not a script-writing service. To be able to help you learn how to do this yourself now and in the future, do you have any attempts at solving this parsing problem that you may share? You tagged the question with both sed and with awk, so I have to assume that you have some idea of how to solve it. In addition to that, the given input and output only differs in the way it's sorted (as far as I can see); could you give an example of where the comparison step actually matters?
– Kusalananda♦
2 days ago
also let's know how first row is generated in your expected output since as I understood next lines are produced with following 3rd column of each row where that appeared in first column of other line (or lines? Is value of 3rd column in each row unique within a file? ) , so how first line is come there is matter. please edit your question for clarification.
– αғsнιη
2 days ago
First row always starts with value SQL.
– Sekhar
2 days ago
@Sekhar That does not help in understanding the ordering of the lines in the output. I would have assumed that the lines were sorted on the last column, but if you say that the first line always should start withSQL
, then it becomes unclear whether a line with something likeAccess
or some other string in the last column should be put just below that or above it. Please edit your question to clarify, taking my other comment into consideration.
– Kusalananda♦
2 days ago
add a comment |
My source data (INput) is like below
EPIC1 router EPIC2 Targetdefinition
Exp1 Expres rtr1 Router
SQL SrcQual Exp1 Expres
rtr1 Router EPIC1 Targetdefinition
My output like
SQL SrcQual Exp1 Expres
Exp1 Expres rtr1 Router
rtr1 Router EPIC1 Targetdefinition
EPIC1 router EPIC2 Targetdefinition
I need to write a Unix script to search 3rd column value in 1st column and display the records in sorted order like above output.
text-processing awk sed
New contributor
My source data (INput) is like below
EPIC1 router EPIC2 Targetdefinition
Exp1 Expres rtr1 Router
SQL SrcQual Exp1 Expres
rtr1 Router EPIC1 Targetdefinition
My output like
SQL SrcQual Exp1 Expres
Exp1 Expres rtr1 Router
rtr1 Router EPIC1 Targetdefinition
EPIC1 router EPIC2 Targetdefinition
I need to write a Unix script to search 3rd column value in 1st column and display the records in sorted order like above output.
text-processing awk sed
text-processing awk sed
New contributor
New contributor
edited 2 days ago
Kusalananda♦
140k17261435
140k17261435
New contributor
asked 2 days ago
SekharSekhar
11
11
New contributor
New contributor
put on hold as off-topic by Rui F Ribeiro, Sparhawk, αғsнιη, Haxiel, Prvt_Yadv yesterday
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
put on hold as off-topic by Rui F Ribeiro, Sparhawk, αғsнιη, Haxiel, Prvt_Yadv yesterday
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
2
Please show us what have you tried to do and where you need Unix enlightenment
– Rui F Ribeiro
2 days ago
3
Someone might help you, but we're not a script-writing service. To be able to help you learn how to do this yourself now and in the future, do you have any attempts at solving this parsing problem that you may share? You tagged the question with both sed and with awk, so I have to assume that you have some idea of how to solve it. In addition to that, the given input and output only differs in the way it's sorted (as far as I can see); could you give an example of where the comparison step actually matters?
– Kusalananda♦
2 days ago
also let's know how first row is generated in your expected output since as I understood next lines are produced with following 3rd column of each row where that appeared in first column of other line (or lines? Is value of 3rd column in each row unique within a file? ) , so how first line is come there is matter. please edit your question for clarification.
– αғsнιη
2 days ago
First row always starts with value SQL.
– Sekhar
2 days ago
@Sekhar That does not help in understanding the ordering of the lines in the output. I would have assumed that the lines were sorted on the last column, but if you say that the first line always should start withSQL
, then it becomes unclear whether a line with something likeAccess
or some other string in the last column should be put just below that or above it. Please edit your question to clarify, taking my other comment into consideration.
– Kusalananda♦
2 days ago
add a comment |
2
Please show us what have you tried to do and where you need Unix enlightenment
– Rui F Ribeiro
2 days ago
3
Someone might help you, but we're not a script-writing service. To be able to help you learn how to do this yourself now and in the future, do you have any attempts at solving this parsing problem that you may share? You tagged the question with both sed and with awk, so I have to assume that you have some idea of how to solve it. In addition to that, the given input and output only differs in the way it's sorted (as far as I can see); could you give an example of where the comparison step actually matters?
– Kusalananda♦
2 days ago
also let's know how first row is generated in your expected output since as I understood next lines are produced with following 3rd column of each row where that appeared in first column of other line (or lines? Is value of 3rd column in each row unique within a file? ) , so how first line is come there is matter. please edit your question for clarification.
– αғsнιη
2 days ago
First row always starts with value SQL.
– Sekhar
2 days ago
@Sekhar That does not help in understanding the ordering of the lines in the output. I would have assumed that the lines were sorted on the last column, but if you say that the first line always should start withSQL
, then it becomes unclear whether a line with something likeAccess
or some other string in the last column should be put just below that or above it. Please edit your question to clarify, taking my other comment into consideration.
– Kusalananda♦
2 days ago
2
2
Please show us what have you tried to do and where you need Unix enlightenment
– Rui F Ribeiro
2 days ago
Please show us what have you tried to do and where you need Unix enlightenment
– Rui F Ribeiro
2 days ago
3
3
Someone might help you, but we're not a script-writing service. To be able to help you learn how to do this yourself now and in the future, do you have any attempts at solving this parsing problem that you may share? You tagged the question with both sed and with awk, so I have to assume that you have some idea of how to solve it. In addition to that, the given input and output only differs in the way it's sorted (as far as I can see); could you give an example of where the comparison step actually matters?
– Kusalananda♦
2 days ago
Someone might help you, but we're not a script-writing service. To be able to help you learn how to do this yourself now and in the future, do you have any attempts at solving this parsing problem that you may share? You tagged the question with both sed and with awk, so I have to assume that you have some idea of how to solve it. In addition to that, the given input and output only differs in the way it's sorted (as far as I can see); could you give an example of where the comparison step actually matters?
– Kusalananda♦
2 days ago
also let's know how first row is generated in your expected output since as I understood next lines are produced with following 3rd column of each row where that appeared in first column of other line (or lines? Is value of 3rd column in each row unique within a file? ) , so how first line is come there is matter. please edit your question for clarification.
– αғsнιη
2 days ago
also let's know how first row is generated in your expected output since as I understood next lines are produced with following 3rd column of each row where that appeared in first column of other line (or lines? Is value of 3rd column in each row unique within a file? ) , so how first line is come there is matter. please edit your question for clarification.
– αғsнιη
2 days ago
First row always starts with value SQL.
– Sekhar
2 days ago
First row always starts with value SQL.
– Sekhar
2 days ago
@Sekhar That does not help in understanding the ordering of the lines in the output. I would have assumed that the lines were sorted on the last column, but if you say that the first line always should start with
SQL
, then it becomes unclear whether a line with something like Access
or some other string in the last column should be put just below that or above it. Please edit your question to clarify, taking my other comment into consideration.– Kusalananda♦
2 days ago
@Sekhar That does not help in understanding the ordering of the lines in the output. I would have assumed that the lines were sorted on the last column, but if you say that the first line always should start with
SQL
, then it becomes unclear whether a line with something like Access
or some other string in the last column should be put just below that or above it. Please edit your question to clarify, taking my other comment into consideration.– Kusalananda♦
2 days ago
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
2
Please show us what have you tried to do and where you need Unix enlightenment
– Rui F Ribeiro
2 days ago
3
Someone might help you, but we're not a script-writing service. To be able to help you learn how to do this yourself now and in the future, do you have any attempts at solving this parsing problem that you may share? You tagged the question with both sed and with awk, so I have to assume that you have some idea of how to solve it. In addition to that, the given input and output only differs in the way it's sorted (as far as I can see); could you give an example of where the comparison step actually matters?
– Kusalananda♦
2 days ago
also let's know how first row is generated in your expected output since as I understood next lines are produced with following 3rd column of each row where that appeared in first column of other line (or lines? Is value of 3rd column in each row unique within a file? ) , so how first line is come there is matter. please edit your question for clarification.
– αғsнιη
2 days ago
First row always starts with value SQL.
– Sekhar
2 days ago
@Sekhar That does not help in understanding the ordering of the lines in the output. I would have assumed that the lines were sorted on the last column, but if you say that the first line always should start with
SQL
, then it becomes unclear whether a line with something likeAccess
or some other string in the last column should be put just below that or above it. Please edit your question to clarify, taking my other comment into consideration.– Kusalananda♦
2 days ago