I sincerely apologize for trying to tell you how to access standard grep -Fx behavior on Solaris systems. Since that was what you were using in your post, I assumed that that was what you wanted. Your script used the command:
and failed with diagnostics saying that the grep utility you had invoked didn't recognize the -F and -x options. The command grep -F can be replaced by fgrep, but if the grep in your $PATH doesn't recognize -x, fgrep isn't likely to either. But, /usr/xpg4/bin/grep -Fx should work IF AND ONLY IF the other operands you supply make sense. So, if $Archivo expands to the name of a regular file that appears in the file List-prosclbt00c-xpbatch-01112016_Q607965_nd.txt as an entire line of text with no other characters on that line, then your command makes sense and should print the expansion of $Archivo if that filename appears as an entire line in that file. But, the contents of the file you showed us in post #5 seems to be a perverted list of absolute pathnames of files sorted with keys being the file mode, the file owner, the file group, the file size, the file last modification time's abbreviated month, the file last modification time's day-of-month, the file last modification time's (hour and minute) or (year), and the file's absolute pathname. But, the pattern you are looking for in this file is the last component of a pathname (which can never happen).
If you are looking for files that might match what is in a file like you showed us in post #5, you might want to try something more like:
Note that we are not looking for fixed strings; we are looking for a filename at the end of a line containing other text (so we don't use fgrep and we don't use grep -F). Since the filenames you're looking for contain <period>s, there is a chance that there will be false matches, but I will make the wild assumption that if you're looking for a file with a name like log_HistoricoRecargas12062016sometext.log it would be unlikely that you would also have a file named log_HistoricoRecargas12062016othertextXlog where sometext followed by a <period> and othertextX are arbitrary but different strings.
Hello,
I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17".
i.e need to get records having exact 17 pipe separated fields(no more or less)
currently i have below :
awk... (1 Reply)
Hi!
I just want to count number of files in a directory, and write to new text file, with number of files and their name
output should look like this,,
assume that below one is a new file created by script
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat... (20 Replies)
Input:
some random text SELECT TABLE1 some more random text
some random text SELECT TABLE2 some more random text
some random text SELECT TABLE3 some more random text
some random text SELECT TABLE1 some more random text
Output:
'SELECT TABLE1' 2
'SELECT TABLE2' 1
'SELECT TABLE3' 1
I... (5 Replies)
I have a file containing about 5 million rows, in the file there are some records which has extra delimiter at random position. (we dont know the positions), now we have to Count the delimeter from each row and if the count of delimeter is not matching then I want to delete those rows from the... (5 Replies)
Hi,
Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time..
Thanks (3 Replies)
Hello all,
I always found help for my problems using the search option, but this time my request is too specific. I have two files that I want to compare. File1 is the index and File2 contains the data:
File1:
chr1 protein_coding exon 500 600 . + . gene_id "20532";... (0 Replies)
Awk Array doesnt match for substring
nawk -F"," 'FNR==NR{a=$2 OFS $3;next} a{print $1,$2,a}' OFS="," file1 file2
I want cluster3 in file1 to match with cluster3int in file2
output getting:
Output required:
Help is appreciated (8 Replies)
hi ,
i have one file ,i need to search particular word from this file and if content is matched then echo MATCHED else NOT MATCHED
file contains : mr x planned to score 75% in exam but end up with 74%.
word to be searched id 75%
please help me out .
waiting for reply
thanks in advance (2 Replies)
I am writing the below script to do a grep and count number of occurances between two tab delimited files.
I am trying to achieve..
1) Extract column 2 and column 3 from the S.txt file. Put it in a temp pattern file
2) Grep and count column 2 in D.txt file
3) Compare the counts between... (19 Replies)