Search Results

Search: Posts Made By: mjf
2,492
Posted By mjf
If your flavor of Unix supports uniq with -D...
If your flavor of Unix supports uniq with -D option, this should meet your requirement of listing all duplicate file names ignoring the first 26 characters.

ls | sort -t'.' -k8,9 | uniq -s 26 -D
1,174
Posted By mjf
boaz733, See this link on several different...
boaz733,
See this link on several different solutions for printing lines between 2 strings:
...
3,006
Posted By mjf
Using sort: sort -m -u -k 2,6 1 20 30 40...
Using sort:

sort -m -u -k 2,6
1 20 30 40 50 60 6
4 30 40 50 60 70 8
3,124
Posted By mjf
How about including your code so we can review...
How about including your code so we can review and help you out?
1,257
Posted By mjf
Try using a FOR loop: FOR %i IN (sec*.txt) DO...
Try using a FOR loop:
FOR %i IN (sec*.txt) DO find %i /c /v ""
4,364
Posted By mjf
find . -type d Searches for directories...
find . -type d
Searches for directories recursively starting from current folder.

\( -name archive -o -name log \) -prune
If directory is named archive or log then remove (prune) it from...
2,433
Posted By mjf
Take a look at -l option in grep. For...
Take a look at -l option in grep.

For example:
grep -l keyword $DIRECTORY/*.log
2,167
Posted By mjf
MadeInGermany, Thanks for the tip, however,...
MadeInGermany,
Thanks for the tip, however, based on the requirement, the check to see if the variable exists in the array needs to be negated:

nawk 'FNR==NR{map[$1];next} !($18 in map)'...
2,167
Posted By mjf
Good, you're welcome. But have you looked at...
Good, you're welcome. But have you looked at identifying these records (or the next ones that you might load) that failed at insert time? Or perhaps this was a one time load and not something you...
2,167
Posted By mjf
Try sometrhing like this: $nawk...
Try sometrhing like this:

$nawk 'FNR==NR{map[$1]=$0;next} !map[$18]' import.txt all.txt
1 1 20152005 630 admin NULL NULL NULL NULL NULL NULL ...
3,023
Posted By mjf
How about removing the hour? awk -F'|'...
How about removing the hour?

awk -F'|' 'NR>2 {array[$1] += $3 count[$1]++ } END { for (a in array) {print a, array[a]/count[a] } } '
Forum: Solaris 03-28-2015
1,609
Posted By mjf
See #4 on below link: Front Panel Controls...
See #4 on below link:

Front Panel Controls and Indicators on Sun SPARC Enterprise T5140 Servers - Sun SPARC Enterprise T5140 and T5240 Servers Topic Set...
3,023
Posted By mjf
I understand the concatenation but what I'm not...
I understand the concatenation but what I'm not getting is why the extra digits being added are off by one for each line. For example, for line 3, I would expect the extra digit in red to be 1...
3,023
Posted By mjf
Don, Yes, I added another test record with...
Don,
Yes, I added another test record with 3/3/2015 date to test the break logic and forgot to remove it from posted output (as OP did not include it in his file). I missed the semi-colon although...
3,340
Posted By mjf
A quick search of this forum should help you...
A quick search of this forum should help you solve your requirement. See this one example using awk:

https://www.unix.com/shell-programming-and-scripting/218015-avg-using-awk.html
6,317
Posted By mjf
kmanivan82, To use RudiC's 2nd suggestion, try:...
kmanivan82,
To use RudiC's 2nd suggestion, try:
awk '{print $1".tmp"}' file_list.txt | xargs -n8 echo rm -f* remove echo once you have tested.

RudiC,
It doesn't appear your 1st suggestion will...
2,488
Posted By mjf
Absolutely! I enjoy reading the posts that peek...
Absolutely! I enjoy reading the posts that peek my interests, chiming in when I can offer a solution and learning from all the variations (there is always more than one way to do something). For...
3,586
Posted By mjf
You can also add comma delimiters between columns...
You can also add comma delimiters between columns and write to csv file. Then open csv file in Excel. Note you will need to choose another delimiter if the data could have embedded commas. Here is an...
1,437
Posted By mjf
You should post the code you have tried so we can...
You should post the code you have tried so we can see what you are doing wrong.

This will do what you have described.

mv `date +"%Y%m%d"` sommelier
4,285
Posted By mjf
Here is one way: echo 'a,blank,12,24' | awk...
Here is one way:

echo 'a,blank,12,24' | awk -F, '{print $0 "," $3+$4}'
a,blank,12,24,36
13,219
Posted By mjf
nanz143, If you are using Autosys, why don't...
nanz143,
If you are using Autosys, why don't you use a calendar definition to run the script only on Sundays?
13,219
Posted By mjf
nanz143, if you have the Autosys job defined to...
nanz143, if you have the Autosys job defined to only run on Sunday's at a set time(s), then it will only run on Sunday's. If you are worried about the possibility that someone could manually force...
1,139
Posted By mjf
Try sed with “i” command to insert a line before...
Try sed with “i” command to insert a line before match for your request to add only one line.

$ cat file.txt
1
2
3
4
5
$ sed "4 i\Inserted new line" file.txt
1
2
3
Inserted new line
4...
2,832
Posted By mjf
Here is an awk solution. Note that the 3rd record...
Here is an awk solution. Note that the 3rd record in your output file does not match your input and requirement as the fields do not match. Assuming that the '&' in the beginning of field 1 is not...
1,012
Posted By mjf
Another way: sort -k6,6 -k12,12nr filename |...
Another way:

sort -k6,6 -k12,12nr filename | awk '!line[$6]++'
Showing results 1 to 25 of 45

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