showing the number of strings in the output filename
Dear all,
I just a script which cut a long txt file into different new txt files.
Since I need to be sure - as a double-checking procedure - that exactly 48 strings (i.e. lines) are included per file. Is there any simple command that would echo the number of strings per file in the output filename?
For example, here is my simple awk command that looks for strings that have the number 2 in the first column:
awk '$1 == "2"{print $0}' filename_alpha > filename_beta
I would like to have an output filename which would look like this one:
filename_beta_48
(48 would be the number of strings that have "2" in the first column)
I thank you very much for your advice.
All the best,
Udiubu
|