Reputation
Top tag
Next privilege 75 Rep.
Set bounties
Badges
7
Impact
~4k people reached

  • 0 posts edited
  • 0 helpful flags
  • 7 votes cast
May
8
comment Using Unix, when detecting a pattern, we need to detect its corresponding other pattern
I'm not able to pass to the command a variable $pattern. Can you please assist? gawk "/===/ {SEC=$0;PRINTED=0} /$pattern/ {if(!PRINTED) print SEC; print $0; PRINTED=1;}" describe.txt
May
8
comment Using Unix, when detecting a pattern, we need to detect its corresponding other pattern
Thank you Eric! gawk worked properly!
May
8
accepted Using Unix, when detecting a pattern, we need to detect its corresponding other pattern
May
8
comment Using Unix, when detecting a pattern, we need to detect its corresponding other pattern
when launching this command I'm getting below error. awk '/===/ {SEC=$0;PRINTED=0} /night/ {if(!PRINTED) print SEC; print $0; PRINTED=1;}' test.txt awk: syntax error near line 1 awk: bailing out near line 1
May
8
asked Using Unix, when detecting a pattern, we need to detect its corresponding other pattern
Nov
21
awarded  Popular Question
Oct
30
awarded  Popular Question
Apr
3
comment Merge 2 files based on all values of the first column of the first file
It worked perfectly, thank you!
Apr
3
comment Merge 2 files based on all values of the first column of the first file
for my case JOIN does not work properly, since I do have the same value in column one of each file.
Apr
3
comment Merge 2 files based on all values of the first column of the first file
I have a question why you are giving as input file2 before file1 ?
Apr
3
accepted Merge 2 files based on all values of the first column of the first file
Apr
3
comment Merge 2 files based on all values of the first column of the first file
game should not appear since my aim is to merge the 2 files based on only all values of column one of FILE1. (in case a value does not exist in file2 then it should be filled zeros)
Apr
3
comment Merge 2 files based on all values of the first column of the first file
mail is intended not to be present in the second file. My aim is to join the 2 files based on only all values of column one of first file. (in case a value does not exist in file2 then it should be filled zeros)
Apr
3
asked Merge 2 files based on all values of the first column of the first file
Apr
2
comment Merge 2 files based on all available values of the first column in both files
the version with line for "total", sorting and skipping lines without difference worked perfectly! Thank you! It was my mistake I added a ; between the for loop and the if statement.
Apr
2
comment Merge 2 files based on all available values of the first column in both files
the version with line for "total", sorting and skipping lines without difference worked perfectly! Thank you!
Apr
2
comment Merge 2 files based on all available values of the first column in both files
in addition can we sort the first column? and can we remove all rows that have as difference value 0?
Apr
2
revised Merge 2 files based on all available values of the first column in both files
edited title
Apr
2
comment Merge 2 files based on all available values of the first column in both files
Is it possible to add in the last row the TOTAL sum for every column?
Apr
2
awarded  Commentator