The awk solution below first stores the low-high file into an array.
As it passes and prints the main file, it notes which "POINT_NAME" is passing by. As LOW_ALARM and HIGH_ALARM lines go by, awk rebuilds those lines if values for that POINT_NAME are in the array.
The BEGIN processing stores the low-high file using default white-space field separation. But it then sets the Field Separator to a double-quote sign for processing of the main file because it makes the coding cleaner and more precise. With this field separator, each tag and each value become a separate field, and thus a little cleaner to identify.
Just for testing, I add (UPD) to the end of lines that I rebuild. I do not test to see if the value actually changes, so the (UPD) just means that I rebuilt the line with a value from the low-high file, even though the value could have remained the same.
I did not rely on POINT_NAME always being the nth word in that header line. I scan the line to isolate it.
Can any one give me the idea on replacing multiple blank lines with a single blank line?
Please conside it for a file having more than 100 number of characters.
Regards,
Siba (3 Replies)
i want to replace mistaken quotes in line starting with tag 300 and relocate the quote in the correct position so the input is
223;25
224;20100428064823;1;0;0;0;0;0;0;0;8;1;3;9697;18744;;;;;;;;;;;;
300;X;Event:... (3 Replies)
Hi,
I have a file with below contents,
ssenthil = rw
anilkg = rw
I want to search for "ssenthil" and need to delete line 1 and 2 , if the third line starts with "" respectively and blank line immediately and third line starts with "
anilkg = rw
Please help me .
Great day... (5 Replies)
Hi All,
I'm trying to parse a XML file and replace few lines of file with text present in another file. But only issue is I need to replace only those lines from XML which are preceeding the JOBNAME =*RRN*
For ex test.xml(content of XML file in which I want to replace lines is )
<JOB
.
.
.... (10 Replies)
Hi friends,
This is sed & awk type question.
I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example
###start of input text file ####
abc
def
ghi
1
2
3
4
kjld
random... (3 Replies)
Hi,
Can anyone help me out for my below problem.
I need to replace all System.out.println with Logger.println in *.java using SED (spanning multiple lines)
including current & sub-directories.
I tried with below command. But it is not replacing when source text is spanned over multiple... (4 Replies)
Background:
I am writing a script to help me automate tweaks and things I apply to a custom Android rom I developed. I am on the very last part of my script, and I am stuck trying to find the right command to do what I seek.
When I build roms from source, a file called updater-script is... (8 Replies)
Hi
Am confused with the usage of "sed" command
I want to replace a single line with multiple lines of a file..
eg.,
A file has
Hi, How are you?
I need to replace as
Am fine
What are You doing?
I used the script as
string1="Hi, How are you?"
echo "$string1 is the value"... (4 Replies)
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
LEARN ABOUT FREEBSD
remquo
REMAINDER(3) BSD Library Functions Manual REMAINDER(3)NAME
remainder, remainderf, remainderl, remquo, remquof, remquol -- minimal residue functions
LIBRARY
Math Library (libm, -lm)
SYNOPSIS
#include <math.h>
double
remainder(double x, double y);
float
remainderf(float x, float y);
long double
remainderl(long double x, long double y);
double
remquo(double x, double y, int *quo);
float
remquof(float x, float y, int *quo);
long double
remquol(long double x, long double y, int *quo);
DESCRIPTION
remainder(), remainderf(), remainderl(), remquo(), remquof(), and remquol() return the remainder r := x - n*y where n is the integer nearest
the exact value of x/y; moreover if |n - x/y| = 1/2 then n is even. Consequently the remainder is computed exactly and |r| <= |y|/2. But
attempting to take the remainder when y is 0 or x is +-infinity is an invalid operation that produces a NaN.
The remquo(), remquof(), and remquol() functions also store the last k bits of n in the location pointed to by quo, provided that n exists.
The number of bits k is platform-specific, but is guaranteed to be at least 3.
SEE ALSO fmod(3), ieee(3), math(3)STANDARDS
The remainder(), remainderf(), remainderl(), remquo(), remquof(), and remquol() routines conform to ISO/IEC 9899:1999 (``ISO C99''). The
remainder is as defined in IEEE Std 754-1985.
HISTORY
The remainder() and remainderf() functions appeared in 4.3BSD and FreeBSD 2.0, respectively. The remquo() and remquof() functions were added
in FreeBSD 6.0, and remainderl() and remquol() were added in FreeBSD 8.0.
BSD March 30, 2008 BSD