hi all,
i would like to search in a directory. all files they were found shoul be opend and looked about a keyword. if keyword is found i want to see the name of the file. i've rtfm of find and have a command like this :
find /etc -exec cat \{}\ | grep KEYWORD
but don't work, and :
find... (4 Replies)
I have a file that contains the following:
Mon Dec 3 15:52:57 PST 2o007: FAILED TO PROCESSED FILE 200712030790881200.TXT - exit code=107
Tue Dec 4 09:08:57 PST 2007: FAILED TO PROCESSED FILE 200712030790879200a.TXT - exit code=107
This file also has a lot more stuff since it is a log file.... (2 Replies)
Hi All,
I have almost 1000+ files and I want to search specific pattern. Looking forwarded your input. Pls note that need to ignore words in between /* */
Search for: "insert into xyz" (Which procedure contain all 3).
Expected output:
procedure test1
procedure test2
procedure test3
File... (12 Replies)
Hi Friends,
I have been trying to write the script since morning and reached some where now. but i think i am stuck in the final step. please help
I want to search the strings below in red in the be be searched in the directories below. How can i do that in my shell script.
Thanks
Adi
... (8 Replies)
Hi all,
I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line.
Let me paste an 2 examples:
anything before
any string begin
few lines of content
end1
anything after
anything before
any... (4 Replies)
Hello,
I'm trying to write a bash script that will search for words from one list that may be found in another list. Once the record is found, it will create a new text file for each word.
For example, list1.txt contains the following:
Dog
Cat
Fish
List2.txt contains
Dog - Buddy 14... (3 Replies)
Hello,
I try to print out with sed or awk the 21.18 between "S3 Temperature" and "GrdC" in a text file.
The blanks are all real blanks no tabs.
Only the two first chars from temperture are required. So the "21" i need as output.
S3 Temperatur 21.18 GrdC No Alarm
... (3 Replies)
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
hi,
i need to replace all words in any quote position and then need to change the words inside the file thousand of raw.
textfile data :
"Ninguno","Confirma","JuicioABC"
"JuicioCOMP","Recurso","JuicioABC"
"JuicioDELL","Nulidad","Nosino"
"Solidade","JuicioEUR","Segundo"
need... (1 Reply)
Discussion started by: benjietambling
1 Replies
LEARN ABOUT LINUX
erl_format
erl_format(3erl) C Library Functions erl_format(3erl)NAME
erl_format - Create and Match Erlang Terms
DESCRIPTION
This module contains two routines - one general function for creating Erlang terms and one for pattern matching Erlang terms.
EXPORTS
ETERM * erl_format(FormatStr, ... )
Types char *FormatStr;
This is a general function for creating Erlang terms using a format specifier and a corresponding set of arguments, much in the way
printf() works.
FormatStr is a format specification string. The set of valid format specifiers is as follows:
* ~i - Integer
* ~f - Floating point
* ~a - Atom
* ~s - String
* ~w - Arbitrary Erlang term
For each format specifier that appears in FormatStr , there must be a corresponding argument following FormatStr . An Erlang term is
built according to the FormatStr with values and Erlang terms substituted from the corresponding arguments and according to the
individual format specifiers. For example:
erl_format("[{name,~a},{age,~i},{data,~w}]",
"madonna",
21,
erl_format("[{adr,~s,~i}]","E-street",42));
This will create an (ETERM *) structure corresponding to the Erlang term: [{name,madonna},{age,21},{data,[{adr,"E-street",42}]}]
The function returns an Erlang term, or NULL if FormatStr does not describe a valid Erlang term.
int erl_match(Pattern, Term)
Types ETERM *Pattern,*Term;
This function is used to perform pattern matching similar to that done in Erlang. Refer to an Erlang manual for matching rules and
more examples.
Pattern is an Erlang term, possibly containing unbound variables.
Term is an Erlang term that we wish to match against Pattern .
Term and Pattern are compared, and any unbound variables in Pattern are bound to corresponding values in Term .
If Term and Pattern can be matched, the function returns a non-zero value and binds any unbound variables in Pattern . If Term Pat-
tern do not match, the function returns 0. For example:
ETERM *term, *pattern, *pattern2;
term1 = erl_format("{14,21}");
term2 = erl_format("{19,19}");
pattern1 = erl_format("{A,B}");
pattern2 = erl_format("{F,F}");
if (erl_match(pattern1, term1)) {
/* match succeeds:
* A gets bound to 14,
* B gets bound to 21
*/
...
}
if (erl_match(pattern2, term1)) {
/* match fails because F cannot be
* bound to two separate values, 14 and 21
*/
...
}
if (erl_match(pattern2, term2)) {
/* match succeeds and F gets bound to 19 */
...
}
erl_var_content() can be used to retrieve the content of any variables bound as a result of a call to erl_match() .
Ericsson AB erl_interface 3.7.3 erl_format(3erl)