Search Results

Search: Posts Made By: is2_egypt
1,689
Posted By Scrutinizer
An empty line when using -f means that one of the...
An empty line when using -f means that one of the patterns that it tries is the empty string and that is always a positive hit, i.e. it matches everything...
$ printf "%s\n" aa bbbb ccc | grep ''...
1,689
Posted By RudiC
Well, is it possible that all lines are correctly...
Well, is it possible that all lines are correctly selected, i.e. are represented in the VI file? I recommend to do some intermediate steps, e.g. 20 and then 50 entries in VI.
1,343
Posted By Scrutinizer
Since we are reading the same file twice, the...
Since we are reading the same file twice, the test for ($1 in A) is superfluous:
awk -F, 'FNR==NR{A[$1]++; next}{print $0 FS A[$1]}' file file
905
Posted By MadeInGermany
Simply add an And condition for print. A...
Simply add an And condition for print.
A commented multi-liner
awk -F, '
# first file read (NR equals FNR)
# store the number of $1 occurrences in A[ ]
(FNR==NR) { A[$1]++; next }
# second file...
1,343
Posted By RudiC
What be your OS and awk version? And,...
What be your OS and awk version?



And, you NEED to repeat the identical input file as the program does two iterations on it. To produce an output file, use shell redirection.
905
Posted By RudiC
Can be done with a small adation to your other...
Can be done with a small adation to your other thread (https://www.unix.com/unix-for-beginners-questions-and-answers/269747-extract-lines-have-dupliucate-count-them.html)'s solution
awk -F,...
1,343
Posted By RavinderSingh13
Hello is2_Egypt, Welcome to forums,...
Hello is2_Egypt,

Welcome to forums, regarding your question, as per your expected output, could you please try following and let me know if this helps.

awk -F, 'FNR==NR{A[$1]++;next} ($1 in...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy