Sponsored Content
Top Forums Shell Programming and Scripting grep exact string from files and write to filename when string present in file Post 302682755 by JC_1 on Monday 6th of August 2012 10:52:39 PM
Old 08-06-2012
Great - That got it - Thanks!
Code:
for i in $(ls mr*); do
  STR=$(strings $i | grep MoCoSeries)
  mv $i $i$STR 
done


Last edited by Franklin52; 08-07-2012 at 04:08 AM.. Reason: Please use code tags for data and code samples
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to use grep to get an exact string?

Hi there, I've search this forum and find this problem could have been solved by, grep -ho "num=*" input_data The input_data is, 1\11\num1=100\num2=200\newnum1=220\\@ however, what I have got is , num1=100 num1=220 how to get the exact string, (4 Replies)
Discussion started by: liuzhencc
4 Replies

2. Linux

Find String in FileName and move the String to new File if not found

Hi all, I have a question.. Here is my requirement..I have 500 files in a path say /a/b/c I have some numbers in a file which are comma seperated...and I wanted to check if the numbers are present in the FileName in the path /a/b/c..if the number is there in the file that is fine..but if... (1 Reply)
Discussion started by: us_pokiri
1 Replies

3. Shell Programming and Scripting

Grep a string and write a value to next line of found string

Hi, I have two variables x and y. i need to find a particular string in a file, a workflow name and then insert the values of x and y into the next lines of the workflow name. basically it is like as below wf_xxxxxx $$a= $$b= $$c= figo $$d=bentley i need to grep the 'wf_xxxx' and then... (6 Replies)
Discussion started by: angel12345
6 Replies

4. Shell Programming and Scripting

grep exact string from a file

Hi, I have the following output from a file zone "adm.test.com" { abc test1.db } zone "test.com" { xyz test2.db } zone "1.test.com.sg" { 1abc test3.db } zone "3.test.com.uk" { 1xyz test4.db } (6 Replies)
Discussion started by: vchee
6 Replies

5. Shell Programming and Scripting

QUESTION1: grep only exact string. QUESTION2: find and replace only exact value with sed

QUESTION1: How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed. Contents of car.txt CAR1_KEY0 CAR1_KEY1 CAR2_KEY0 CAR2_KEY1 CAR1_KEY10 CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1 grep... (1 Reply)
Discussion started by: thibodc
1 Replies

6. UNIX for Dummies Questions & Answers

How to grep the exact string / word ?

Hi All, I have a text / log file which contains strings like meta777, 77, meta, 777. Now I want to write a script which can detect a string 'meta#777' in a text file & number of occurence of 'meta', number of #, number 7, 77, 777. I'm using grep -e '77' filename but no luck. It is returning... (5 Replies)
Discussion started by: adc22
5 Replies

7. Shell Programming and Scripting

Grep string in files and list file names that contain the string

Hi, I have a list of zipped files. I want to grep for a string in all files and get a list of file names that contain the string. But without unzipping them before that, more like using something like gzcat. My OS is: SunOS test 5.10 Generic_142900-13 sun4u sparc SUNW,SPARC-Enterprise (8 Replies)
Discussion started by: apenkov
8 Replies

8. Shell Programming and Scripting

Grep exact string from main string

Hi , am getting output file, it sontains the below values. ./hawk_DOM1_FIRST_ENV ./hawk_DOM2_SECOND_ENV ./hawk_DOM3_THIRD_ENV Now I need to grep the word "DOM1_FIRST_ENV","DOM2_SECOND_ENV" like that. I tired with cut -d "_". Its not working with any deleimiter. Can you please help to... (3 Replies)
Discussion started by: ckchelladurai
3 Replies

9. UNIX for Dummies Questions & Answers

How to grep exact string with quotes and variable?

As the title says I'm running a korn script in attempts to find an exact match in named.conf finddomain.ksh #!/bin/ksh # echo "********** named.conf ************" file=/var/named/named.conf for domain in `cat $1` do grep -n '"\$domain "' $file done echo "********** thezah.inc... (1 Reply)
Discussion started by: djzah
1 Replies

10. Shell Programming and Scripting

Grep to find an exact string

Hi all, I tried searching the forum for this, and I read numerous suggestions here and even on other forums, and I cannot get this to want the way that I need it to. I tried grep -W / -f to no luck. Here is what I have. I have a list of file names- FILE1-FILE1TEST,FILE1RELATION... (7 Replies)
Discussion started by: jeffs42885
7 Replies
MECAB(1)							       MeCab								  MECAB(1)

NAME
mecab - manual page for mecab of 0.95pre1 SYNOPSIS
mecab [options] files DESCRIPTION
MeCab: Yet Another Part-of-Speech and Morphological Analyzer Copyright(C) 2001-2007 Taku Kudo Copyright(C) 2004-2006 Nippon Telegraph and Telephone Corporation -r, --rcfile=FILE use FILE as resource file -d, --dicdir=DIR set DIR as a system dicdir -u, --userdic=FILE use FILE as a user dictionary -l, --lattice-level=INT lattice information level (default 0) -D, --dictionary-info show dictionary information and exit -a, --all-morphs output all morphs(default false) -O, --output-format-type=TYPE set output format type (wakati,none,...) -p, --partial partial parsing mode -F, --node-format=STR use STR as the user-defined node format -U, --unk-format=STR use STR as the user-defined unk format -B, --bos-format=STR use STR as the user-defined bos format -E, --eos-format=STR use STR as the user-defined eos format -x, --unk-feature=STR use STR as the feature for unknown word -b, --input-buffer-size=INT set input buffer size (default 8192) -P, --dump-config dump MeCab parameters -C, --allocate-sentence allocate new memory for input sentence -N, --nbest=INT output N best results (default 1) -t, --theta=FLOAT set temparature parameter theta (default 0.75) -o, --output=FILE set the output file name -v, --version show the version and exit. -h, --help show this help and exit. mecab of 0.95pre1 March 2007 MECAB(1)
All times are GMT -4. The time now is 07:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy