hi gurus,
I am having a file containing a list of tables.i want to find the count of records inside thes tables.
for this i have to connect into database and i have to put the count for all the tables inside another file i used the following loop once all the tablenames are inside the file.
... (1 Reply)
hi....
I have a file having more then thousand lines.
i want to remove selected lines in it.
And also if there exists two duplicate lines, I want to delete one of them.
Please help me with awk and shell.
:confused: (8 Replies)
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
I have a very large file (10,000,000 lines), that contains a sample id and a property of that sample. I have another file that contains around 1,000,000 lines with sample ids that I want to remove from the original file (create a new file without these lines).
I know how to do this in Perl, but it... (9 Replies)
Hello Everyone
I need your help in fixing this issue., I have a log file which has data of users logging in to an application.
I want to search for a particular pattern in the log
ISSessionValidated=N
If this key word is found , the above 8 lines will contain the name of the user who's... (12 Replies)
Hi,
I am new to shell scripting and is working on a script to extract lines from a log file between two time stamps using awk command. After some research I used following command:
awk '/01 Oct 2011/{p=1} /10 Oct 2011/{p=0} p' test.log >> tmp.log
This works fine. But now i want to... (3 Replies)
Hi,
I have a file with a '|' pipe delimeter. I want to find number of counts for a particular pattern in particular field. Is it possible to do it in a single command?
1) want to find total number of "0" in field 4.
2) want to find total number of different records in field 4 ( similar to... (5 Replies)
Hi,
I have a file that is 430K lines long. It has records like below
|site1|MAP
|site2|MAP
|site1|MODAL
|site2|MAP
|site2|MODAL
|site2|LINK
|site1|LINK
My task is to count the number of time MAP, MODAL, LINK occurs for a single site and write new records like below to a new file
... (5 Replies)
What i'm trying to do here is show X amount of lines before and after the string "serialNumber" is found.
BEFORE=3
AFTER=2
gawk '{a=$0} {count=0} /serialNumber/ && /./ {for(i=NR-'"${BEFORE}"';i<=NR;i++){count++ ;print a}for(i=1;i<'"${AFTER}"';i++){getline; print ; count ++; print... (5 Replies)
Discussion started by: SkySmart
5 Replies
LEARN ABOUT DEBIAN
preprocess
PREPROCESS(1) General Commands Manual PREPROCESS(1)NAME
preprocess - Preprocess a file.
SYNOPSIS
preprocess [options...] infile
DESCRIPTION
Preprocess is like a typical C preprocessor, but it extends to multiple languages. Languages for which it works include: C++, Python, Perl,
Tcl, XML, JavaScript, CSS, IDL, TeX, Fortran, PHP, Java, Shell scripts (Bash, CSH, etc.) and C#. Preprocess is usable both as a command
line app and as a Python module.
OPTIONS -h, --help
Print help text and exit.
-V, --version
Print the version info and exit.
-v, --verbose
Give verbose output for errors.
-o outfile
Write output to the given file instead of to stdout.
-f, --force
Overwrite given output file. Otherwise an IOError will be raised if outfile already exists.
-D define
Define a variable for preprocessing. define can simply be a variable name (in which case it will be true) or it can be of the form
var=val. An attempt will be made to convert val to an integer so "-D FOO=0" will create a false value.
-I dir Add a directory to the include path for #include directives.
-k, --keep-lines
Emit empty lines for preprocessor statement lines and skipped output lines. This allows line numbers to stay constant.
-s, --substitute
Substitute defines into emitted lines. By default substitution is NOT done because it currently will substitute into program
strings.
MODULE USAGE
from preprocess import preprocess
preprocess(infile, outfile=sys.stdout, defines={}, force=0,
keepLines=0, includePath=[], substitute=0)
The <infile> can be marked up with special preprocessor statement lines of the form:
<comment-prefix> <preprocessor-statement> <comment-suffix>
where the <comment-prefix/suffix> are the native comment delimiters for that file type.
EXAMPLES
HTML (*.htm, *.html) or XML (*.xml, *.kpf, *.xul) files:
<!-- #if FOO -->
...
<!-- #endif -->
Python (*.py), Perl (*.pl), Tcl (*.tcl), Ruby (*.rb), Bash (*.sh), or make ([Mm]akefile*) files:
# #if defined('FAV_COLOR') and FAV_COLOR == "blue"
...
# #elif FAV_COLOR == "red"
...
# #else
...
# #endif
C (*.c, *.h), C++ (*.cpp, *.cxx, *.cc, *.h, *.hpp, *.hxx, *.hh), Java (*.java), PHP (*.php) or C# (*.cs) files:
// #define FAV_COLOR 'blue'
...
/* #ifndef FAV_COLOR */
...
// #endif
Fortran 77 (*.f) or 90/95 (*.f90) files:
C #if COEFF == 'var'
...
C #endif
PREPROCESSOR SYNTAX
Valid statements:
#define <var> [<value>]
#undef <var>
#ifdef <var>
#ifndef <var>
#if <expr>
#elif <expr>
#else
#endif
#error <error string>
#include "<file>"
where <expr> is any valid Python expression.
The expression after #if/elif may be a Python statement. It is an error to refer to a variable that has not been defined by a -D option or
by an in-content #define.
Special built-in methods for expressions:
defined(varName) Return true if given variable is defined.
TIPS
A suggested file naming convention is to let input files to preprocess be of the form <basename>.p.<ext> and direct the output of prepro-
cess to <basename>.<ext>, e.g.:
preprocess -o foo.py foo.p.py
The advantage is that other tools (esp. editors) will still recognize the unpreprocessed file as the original language.
AUTHORS
Trent Mick <trentm@gmail.com>
This manual page was written by Johannes Ring <johannr@simula.no> for the Debian GNU/Linux system (but may be used by others).
PREPROCESS(1)