I have a program which I am trying to improve and I hope you can help me
1 ) My main program took a file and list of words such as [the, and, is, that, there]
2) Created a matrix of the patter of 2 by 2s of instances where one word was followed by the other word.
3) Save each pattern in a file
So having a list like
1
the book is black...
2
the dog and its owner...
3
the box of tissues...
4
of the edge ...
The I would have files such as
The.*is
the book is
The .* and
the bog and
For this I was using the following lines
now I want to create a pattern of Three but I tried adding Z to it but it didn't work and I don't know what I am doing wrong
so the outcome should have a result like
I have no specific file or list of words yet but the concept is to see the pattern of things like words that come together or within small distance. For example “strategic business managements” is more likely than “strategic engineering management”
I am testing now on simple texts. Here I attached some lines from a novel (test 01.txt) and put the list as [the be to of and] as they are more frequent and it will help me to see any pattern. Test02 is windows of 10 starting with the list within a sentence and that’s the input for seeing the pattern
And the final result of all of this is
to do is drive to Una and
the morning last August Bank Holiday and forced me to
hope that does make sense.
I have done the same with two words with the code mentioned above and its file but not sure how y it is not working when I add another FOR
I have solved the Issue and it was a syntax error. the line should be corrected with the right lines and breaks otherwise the whole page will be considered as a line
I am still facing some problems but it is related to the loop and not the GREP so I guess I have to ask it in another thread
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases?
This would seem to involve find, xargs, *grep, regex, etc.
In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank).
In a first approach I coded:
find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt
But this doesn't work. I got an error (under Ubuntu):
grep:... (5 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi all,
can any one suggest me the script to grep multiple strings from ps -ef
pls correct the below script . its not working/
i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK.
bash-3.00$ ps -ef | grep blu
lscpusr 48 42 ... (11 Replies)
AIX 4.2
I am trying to do an rsh grep to search for date records inside server logs by doing this :
xx=`date +"%a %b %d"`
rsh xxx grep "^$XX" zzz
gives :
grep: 0652-033 Cannot open Jun.
grep: 0652-033 Cannot open 11.
But if I do :
xx=`date +"%a %b %d"`
grep "^$XX" zzz
it works... (2 Replies)
Hi,
I don't know hot to make this command work:
ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"
It should return the list of file .txt
It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)