Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to preserve the same text and modify the same text to append? Post 303039458 by Mannu2525 on Sunday 6th of October 2019 02:35:17 AM
Old 10-06-2019
How to preserve the same text and modify the same text to append?

Hi,

I have an issue modifying a file. Below is the content of the file.

File name - a.txt
Code:
SELECT LISTAGG(SCORE),   LISTAGG(VB), 
	   LISTAGG(SCORE*12 + 3),
	   LISTAGG(DOB) 
	   from T_CONCAT ;
	   
SELECT LISTAGG(SCORE),
       LISTAGG(VB),
	   LISTAGG(SCORE*100 + 3),
	   from T_CONCAT ;

This is what I desired to come:-

Code:
--ignore begin
SELECT LISTAGG(SCORE),   LISTAGG(VB), 
	   LISTAGG(SCORE*12 + 3),
	   LISTAGG(DOB) 
	   from T_CONCAT ;
--ignore end

SELECT CountMannuArray(LISTAGG(SCORE)),
       CountMannuArray(LISTAGG(VB)),
	   CountMannuArray(LISTAGG(SCORE*12 + 3)),
	   CountMannuArray(LISTAGG(DOB)) 
	   from T_CONCAT ;

--ignore begin	   
SELECT LISTAGG(SCORE),
       LISTAGG(VB),
	   LISTAGG(SCORE*100 + 3),
	   from T_CONCAT ;	   
--ignore end

SELECT CountMannuArray(LISTAGG(SCORE)),
       CountMannuArray(LISTAGG(VB)),
	   CountMannuArray(LISTAGG(SCORE*100 + 3)),
	   CountMannuArray(LISTAGG(DOB)) 
	   from T_CONCAT ;

I find it difficult to preserve the same text and put it in --ignore begin and --ignore end clause.

Other one is achieved by
Code:
sed -i  's/LISTAGG/CountMannuArray(LISTAGG/g;s/)/))/g' a.txt

Please advice.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modify a text or xml file

Hi all, I want to write a shell which would allow me to edit a text file or a xml file. Basically i want to add a new node in a existing xml file. The values for this new node are based on user input. Thanks in advance Zing (9 Replies)
Discussion started by: zing
9 Replies

2. Shell Programming and Scripting

Modify Specific Line of a Text File

Given a text file, how do you add a line of text after a specific line number? I believe I would want to use "sed" but I am unsure of the syntax. Thank you. Mike (5 Replies)
Discussion started by: msb65
5 Replies

3. Shell Programming and Scripting

how preserve the content of the text box

I have used get method in my form and retrieving the content of text box in $value using: $buffer = $ENV{'QUERY_STRING'}; ($name,$value)=split(/=/,$buffer); Now I want to preserve my text box: I had tried: print "<form action='/cgi-bin/abcd.cgiv' method='get'>"; print "<input... (7 Replies)
Discussion started by: therockravi
7 Replies

4. UNIX for Dummies Questions & Answers

Modify Text File

Hi, I would like to remove any lines from a text file that begin with #, or that are blank. How can I do that with BASH? Mike (3 Replies)
Discussion started by: msb65
3 Replies

5. Shell Programming and Scripting

Modify text file using shell script

Hi, I have a text file which is following format - COL VAL ABC 1 ABC 2 ABC 3 ABC 4 ABC 5 My requirement is to search for a particular value (provided by user) in the file and comment the previous entries including that as well. E.g. If I search for number 3, then the output... (6 Replies)
Discussion started by: bhupinder08
6 Replies

6. Shell Programming and Scripting

Modify the text file by script

Hi All the Helpers! I have a text file which looks like input.txt.I would request to please suggest me how can I make this file look like output.txt input.txt VOP 111 0 1 2 DEM 111 0 222 333 444 555 879 888 987 888 989 VOP 118 0... (2 Replies)
Discussion started by: Indra2011
2 Replies

7. Shell Programming and Scripting

Use sed to append text to filenames if text not already present

I have some html with hrefs that contain local links to pdf filenames. These filenames should have standardised names, i.e. there should be a label prior to the ".pdf" filename suffix. There can be many of these links on a single line of text and some may already have the label. For example ... (13 Replies)
Discussion started by: adb
13 Replies

8. Shell Programming and Scripting

Modify one line in a plain text file

Hi everyone, I want to know, if there is a way to modify one line in a text file with unix script, with out re-writing all the file. For example, i have this file: CONFIGURATION_1=XXXX CONFIGURATION_2=YYYY CONFIGURATION_3=ZZZZ supose i have a command or function "modify" that... (7 Replies)
Discussion started by: Xedrox
7 Replies

9. Shell Programming and Scripting

Modify text file using awk

I have text file with lines as shown here. Each row has 11 columns separated by tab. In each row, i want to split the 8th column such that the output should look like shown below. Here value in the 9th column is DP value and in the 10th column is MQ value followed by the values after resource.EFF=.... (15 Replies)
Discussion started by: mehar
15 Replies

10. Shell Programming and Scripting

Modify text file using sed

Hello all, I have some text files I need to do the following on: Delete banner page (lines 1-56) --I am doing this using sed Remove ^M --I am doing this using vi Remove trailer page --this can vary based on the contents of the file, it usually starts with *************************** I am... (5 Replies)
Discussion started by: jeffs42885
5 Replies
policyd-weight.conf(5)						File Formats Manual					    policyd-weight.conf(5)

NAME
policyd-weight.conf - policyd-weight configuration parameters STATUS
Beta, Documentation incomplete DESCRIPTION
policyd-weight uses a perl(1) style configuration file which it reads on startup. The cache re-reads the configuration after $MAINTE- NANCE_LEVEL (default: 5) queries. If -f is not specified, it searches for configuration files on following locations: /etc/policyd-weight.conf /usr/local/etc/policyd-weight.conf ./policyd-weight.conf CACHE SETTINGS
$CACHESIZE (default: 2000) Set the minimum size of the SPAM cache. $CACHEMAXSIZE (default: 4000) Set the maximum size of the SPAM cache. $CACHEREJECTMSG (default: 550 temporarily blocked because of previous errors)" Set the SMTP status code and a explanatory message for rejected mails due to cached results $NTTL (default: 1) The client is penalized for that many retries. $NTIME (default: 30) The $NTTL counter will only be decremented if the client waits at least $NTIME seconds. $POSCACHESIZE (default: 1000) Set the minimum size of the HAM cache. $POSCACHEMAXSIZE (default: 2000) Set the maximum size of the HAM cache. $PTTL (default: 60) After that many queries the HAM entry must succeed one run through the RBL checks again. $PTIME (default: 3h) after $PTIME in HAM Cache the client must pass one time the RBL checks again. Values must be nonfractal. Accepted time-units: s(econds), m(inutes), h(ours), d(ays) $TEMP_PTIME (default: 1d) The client must pass this time the RBL checks in order to be listed as hard-HAM. After this time the client will pass immediately for PTTL within PTIME. Values must be non-fractal. Accepted time-units: s(econds), m(inutes), h(ours), d(ays) DEBUG SETTINGS
$DEBUG (default: 0) Turn debugging on (1) or off (0) DNS SETTINGS
$DNS_RETRIES (default: 2) How many times a single DNS query may be repeated $DNS_RETRY_IVAL (default: 2) Retry a query without response after that many seconds $MAXDNSERR (default: 3) If that many queries fail, the mail is accepted with $MAXDNSERRMSG. In total DNS queries this means: $MAXDNSERR * $DNS_RETRIES MISC SETTINGS
$MAINTENANCE_LEVEL (default: 5) After that many policy requests the cache (and in daemon mode child processes) checks for configuration file changes $MAXIDLECACHE (default: 60) After that many seconds of being idle the cache checks for configuration file changes. $PIDFILE (default: /var/run/policyd-weight.pid) Path and filename to store the master pid (daemon mode) $LOCKPATH (default: /tmp/.policyd-weight/) Directory where policyd-weight stores sockets and lock-files/directories. Its argument must contain a trailing slash. $SPATH (default: $LOCKPATH.'/polw.sock') Path and filename which the cache has to use for communication. $TCP_PORT (default: 12525) TCP port on which the policy server listens (daemon mode) $BIND_ADDRESS (default: '127.0.0.1') IP Address on which policyd-weight binds. Currently either only one or all IPs are supported. Specify 'all' if you want to listen on all IPs. $SOMAXCONN (default: 1024) Maximum connections which policyd-weight accepts. This is set high enough to cover most scenarios. $USER (default: polw) Set the user under which policyd-weight runs $GROUP (default: $USER) Set the group under which policyd-weight runs OUTPUT AND LOG SETTINGS
$ADD_X_HEADER (default: 1) Insert a X-policyd-weight: header with evaluation messages. 1 = on, 0 = off $LOG_BAD_RBL_ONLY (default: 1) Insert only RBL results in logging strings if the RBL score changes the overall score. Thus RBLs with a GOOD SCORE of 0 don't appear in logging strings if the RBL returned no BAD hit. 1 = on, 0 = off $MAXDNSBLMSG (default: 550 Your MTA is listed in too many DNSBLs) The message sent to the client if it was reject due to $MAXDNSBLHITS and/or $MAXDNSBLSCORE. $REJECTMSG (default: 550 Mail appeared to be SPAM or forged. Ask your Mail/DNS-Adminisrator to correct HELO and DNS MX settings or to get removed from DNSBLs) Set the SMTP status code for rejected mails and a message why the action was taken RESOURCE AND OPTIMIZATIONS
$CHILDIDLE (default: 120) How many seconds a child may be idle before it dies (daemon mode) $MAX_PROC (default: 50) Process limit on how many processes policyd-weight will spawn (daemon mode) $MIN_PROC (default: 2) Minimum child processes which are kept alive in idle times (daemon mode) $PUDP (default: 0) Set persistent UDP connections used for DNS queries on (1) or off (0). SCORE SETTINGS
Positive values indicate a bad (SPAM) score, negative values indicate a good (HAM) score. @bogus_mx_score (2.1, 0) If the sender domain has neither MX nor A records or these records resolve to a bogus IP-Address (for instance private networks) then this check asigns the full score of bogus_mx_score. If there is no MX but an A record of the sender domain then it receives a penalty only if DNSBL-listed. Log Entries: BOGUS_MX The sender A and MX records are bogus or empty. BAD_MX The sender domain has an empty or bogus MX record and the client is DNSBL listed. Related RFCs: [1918] Address Allocation for Private Internets [2821] Simple Mail Transfer Protocol (Sect 3.6 and Sect 5) @client_ip_eq_helo_score (1.5, -1.25) Define scores for the match of the reverse record (hostname) against the HELO argument. Reverse lookups are done, if the forward lookups failed and are not trusted. Log Entries: REV_IP_EQ_HELO The Client's PTR matched the HELO argument. REV_IP_EQ_HELO_DOMAIN Domain portions of Client PTR and HELO argument matched. RESOLVED_IP_IS_NOT_HELO Client PTRs found but did not match HELO argument. @helo_score (1.5, -2) Define scores for the match of the Client IP and its /24 subnet against the A records of HELO or MAIL FROM domain/host. It also holds the bad score for MX verifications. Log Entries: CL_IP_EQ_HELO_NUMERIC Client IP matches the [IPv4] HELO. CL_IP_EQ_FROM_IP Client IP matches the A record of the MAIL FROM sender domain/host. CL_IP_EQ_HELO_IP Client IP matches the A record of the HELO argument. CL_IP_NE_HELO The IP and the /24 subnet did not match A/MX records of HELO and MAIL FROM arguments and their subdomains. @helo_from_mx_eq_ip_score (1.5, -3.1) Define scores for the match of Client IP against MX records. Positive (SPAM) values are used in case the MAIL FROM matches not the HELO argument AND the client seems to be dynamic AND the client is no MX for HELO and MAIL FROM arguments. The total DNSBL score is added to its bad score. Log Entries: CL_IP_EQ_FROM_MX Client IP matches the MAIL FROM domain/host MX record CL_IP_EQ_HELO_MX Client IP matches the HELO domain/host MX record CLIENT_NOT_MX/A_FROM_DOMAIN Client is not a verified HELO and doesn't match A/MX records of MAIL FROM argument CLIENT/24_NOT_MX/A_FROM_DOMAIN Client's subnet does not match A/MX records of the MAIL FROM argument $dnsbl_checks_only (default: 0) Disable HELO/RHSBL verifications and the like. Do only RBL checks. 1 = on, 0 = off @dnsbl_score (default: see below) A list of RBLs to be checked. If you want that a host is not being evaluated any further if it is listed on several lists or a very trustworthy list you can control a immediate REJECT with $MAXDNSBLHITS and/or $MAXDNSBLSCORE. A list of RBLs must be build as fol- lows: @dnsbl_score = ( RBLHOST1, HIT SCORE, MISS SCORE, LOG NAME, RBLHOST2, HIT SCORE, MISS SCORE, LOG NAME, ... ); The default is: @dnsbl_score = ( "dynablock.njabl.org", 3.25, 0, "DYN_NJABL", "dnsbl.njabl.org", 4.25, -1.5, "BL_NJABL", "bl.spamcop.net", 1.75, -1.5, "SPAMCOP", "sbl-xbl.spamhaus.org", 4.35, -1.5, "SBL_XBL_SPAMHAUS", "list.dsbl.org", 4.35, 0, "DSBL_ORG", "ix.dnsbl.manitu.net", 4.35, 0, "IX_MANITU", "relays.ordb.org", 3.25, 0, "ORDB_ORG" ); @rhsbl_score (default: see below) Define a list of RHSBL host which are queried for the sender domain. Results get additionally scores of 0.5 * DNSBL results and @rhsbl_penalty_score. A list of RHSBL hosts to be queried must be build as follows: @rhsbl_score = ( RHSBLHOST1, HIT SCORE, MISS SCORE, LOG NAME, RHSBLHOST2, HIT SCORE, MISS SCORE, LOG NAME, ... ); The default is: @rhsbl_score = ( "rhsbl.ahbl.org", 1.8, 0, "AHBL", "dsn.rfc-ignorant.org", 3.2, 0, "DSN_RFCI", "postmaster.rfc-ignorant.org", 1 , 0, "PM_RFCI", "abuse.rfc-ignorant.org", 1, 0, "ABUSE_RFCI" ); @rhsbl_penalty_score (3.1, 0) This score will be added to each RHSBL hit if following criterias are met: Sender has a random local-part (i.e. yztrzgb@example.tld) or MX records of sender domain are bogus or FROM matches not HELO or HELO is untrusted (Forward record matched, reverse record did not match) $MAXDNSBLHITS (default: 2) If the client is listed in more than $MAXDNSBLHITS RBLs it will be rejected immediately with $MAXDNSBLMSG and without further evalu- ation. Results are cached by default. $MAXDNSBLSCORE (default: 8) If the BAD SCOREs of @dnsbl_score listed RBLs reach a level greater than $MAXDNSBLSCORE the client will be rejected immediately with $MAXDNSBLMSG and without further evaluation. Results are cached by default. $REJECTLEVEL (default: 1) Score results equal or greater than this level will be rejected with $REJECTMSG SEE ALSO
policyd-weight(8), Policyd-weight daemon perl(1), Practical Extraction and Report Language perlsyn(1), Perl syntax access(5), Postfix SMTP access control table LICENSE
GNU General Public License AUTHOR
Robert Felber <r.felber@ek-muc.de> Autohaus Erich Kuttendreier 81827 Munich, Germany Aug 25th, 2006 policyd-weight.conf(5)
All times are GMT -4. The time now is 04:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy