'This is a sample file for testing'
This does not have quotations
this also does not have quotations.
and this 'has quotations'.
first 'quotation 1' and second 'quotation 2', no more...
complete 'complete quotation' and 'incomplete
Output:
Code:
This is a sample file for testing
has quotations
quotation 1
quotation 2
complete quotation
Last edited by aigles; 07-09-2007 at 10:53 AM..
Reason: Add support for incomplete quoted string
I'm working with a java-based monitoring tool (Solaris/x86) which can be configured to call a shell script when a particular event occurs. The java app sends a set of quoted strings as input to the shell script.
The problem I'm running into is that the shell script, when called by the java app,... (0 Replies)
I've created an awk script that handles a varying number of search strings handed to it as command line parameters ($1 $2 etc). There may be 1, or 2 or 3 or more. A simplified version of the script is:
awk -v TYP="$1 $2 $3 $4 $5 $6" '
BEGIN {
CTYP = split (TYP,TYPP," ")
}
... (2 Replies)
Hi, how do I match a particular element in a list and replace it with blank?
awk 'sub///' $FILE
list="AL, AK, AZ, AR, CA, CO, CT, DE, FL, GA,
HI, ID, IL, IN, IA, KS, KY, LA, ME, MD,
MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ,
NM, NY, NC, ND, OH, OK, OR, PA, RI, SC,
SD, TN, TX, UT, VT, VA, WA,... (2 Replies)
If i wanted to search for two strings that are on lines in the log, how do I do it?
The following code searches for just one string that is one one line.
awk '/^/ {split($2,s,",");a=$1 FS s} /failure agaf@fafa/ {b=a} END{print b}' urfile
What if I wanted to search for "failure agaf@fafa"... (3 Replies)
Hi, i would really appreciate any help anyone can give with the following info.
Thanks in advance.
I need to run a search on a file that contains thousands of trades, each trade is added into the file in blocks of 25 lines. i know the search has to take place between a time stamp specified... (4 Replies)
I am wanting to take a list of strings and loop through a list of textfiles to find matches. Preferably with awk and parsing the search strings into an array.
// Search_strings.txt
tag
string
dummy
stuff
things
// List of files to search in
textfile1.txt
textfile2.txt
The... (6 Replies)
I would like to search for strings stored in searchstringfile.txt in inputfiles.
searchstringfile.txt
J./F.
Gls. Wal
F.
Towerinput1.txt
What is needed is J./F. 12 var Gls. Wal 16 interp. Tower 12 input2.txt
Awk shall search for F. 16 pt. J./F. 22 output.txt
input1.txt J./F. = 12 var... (3 Replies)
Hi,
I have a text file with the following content:
monday,20
tuesday,10
wednesday,29
monday,10
friday,12
wednesday,14
monday,15
thursday,34
i want the following output:
monday,45
tuesday,10
wednesday,43
friday,12 (3 Replies)
Hi,
I have a file filled with search strings which have a blank in between and look like this:
S. g. Ehr.
o. Jg.
v. d. Chijs
g. Ehr.
Now i would like to search for the strings and it also shall return the next column after the match.
awk -v FILE="search_strings.txt" 'BEGIN {... (10 Replies)
I am trying to extract multiple strings from snmp-mib files like below.
-----
$ cat IF-MIB.mib
<snip>
linkDown NOTIFICATION-TYPE
OBJECTS { ifIndex, ifAdminStatus, ifOperStatus }
STATUS current
DESCRIPTION
"A linkDown trap signifies that the SNMP entity, acting in... (5 Replies)
Discussion started by: genzo
5 Replies
LEARN ABOUT DEBIAN
camlp4
CAMLP4(1) User Commands CAMLP4(1)NAME
CamlP4 - Pre-Processor-Pretty-Printer for Objective Caml
SYNOPSIS
camlp4 [load-options] [--] [other-options]
DESCRIPTION
Camlp4 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers tools for syntax (Stream Parsers and Grammars) and the ability to
modify the concrete syntax of the language (Quotations, Syntax Extensions).
The Objective Caml compiler has a special option "-pp", allowing to call any preprocessor. If Camlp4 is used, the parsing is done (only
once) by Camlp4, and the Objective Caml compiler resumes the rest of the compilation (typing, code generation).
Camlp4 can parse normal OCaml concrete syntax or any other user-definable syntax. As an example, an alternative syntax is provided, named
Revised, because it tries to fix some problems of the original syntax.
Camlp4 can pretty print the normal OCaml concrete syntax or the revised one (Pretty-Printer). It is therefore always possible to have a
version of your sources compilable by the compiler Objective Caml without preprocessing.
Camlp4 can also serve as a Program Transformation tool, the user can supply transformations and apply them easily as a pre-processing task.
This is done with Filters.
OPTIONS
<file>.ml
Parse this implementation file
<file>.mli
Parse this interface file
<file>.(cmo|cma)
Load this module inside the Camlp4 core
-I <directory>
Add directory in search patch for object files.
-where Print camlp4 library directory and exit.
-nolib No automatic search for object files in library directory.
-intf <file>
Parse <file> as an interface, whatever its extension.
-impl <file>
Parse <file> as an implementation, whatever its extension.
-str <string>
Parse <string> as an implementation.
-unsafe
Generate unsafe accesses to array and strings.
-noassert
Obsolete, do not use this option.
-verbose
More verbose in parsing errors.
-loc <name>
Name of the location variable (default: _loc).
-QD <file>
Dump quotation expander result in case of syntax error.
-o <file>
Output on <file> instead of standard output.
-v Print Camlp4 version and exit.
-version
Print Camlp4 version number and exit.
-no_quot
Don't parse quotations, allowing to use, e.g. "<:>" as token.
-loaded-modules
Print the list of loaded modules.
-parser <name>
Load the parser Camlp4Parsers/<name>.cmo
-printer <name>
Load the printer Camlp4Printers/<name>.cmo
-filter <name>
Load the filter Camlp4Filters/<name>.cmo
-ignore
ignore the next argument
-- Deprecated, does nothing
Options added by loaded object files:
-I <string>
Add a directory to INCLUDE search path.
-U <string>
Undefine for IFDEF instruction.
-D <string>
Define for IFDEF instruction.
-meta_action
Undocumented
-split_gext
Old name for the option -split_ext.
-split_ext
Split EXTEND by functions to turn around a PowerPC problem.
-help_seq
Print explanations about new sequences and exit.
SEE ALSO ocamlc(1), ocaml(1).
The full documentation for CamlP4 is being developed on a Wiki available on the web at
<http://brion.inria.fr/gallium/index.php/Camlp4>.
AUTHOR
CamlP4 is Copyright INRIA, it was mainly written by Nicolas Pouillard.
This manual page was written by Stefano Zacchiroli <zack@debian.org>, for the Debian project (but may be used by others).
CamlP4 3.10.0 June 2007 CAMLP4(1)