Sponsored Content
Full Discussion: How to replace pattern?
Top Forums Shell Programming and Scripting How to replace pattern? Post 303012721 by sadique.manzar on Thursday 8th of February 2018 01:10:46 AM
Old 02-08-2018
How to replace pattern?

Code:
1 | HTTP | ^~
1 | HTTP | ^~&<?1;?;-unp~xn~lP4WM}~!0%#8?;+5vl9`#ep3q6X1772goci3fj`nc7M1?`"*"#&1 ?;?=>k4NQ="#$3(> | 20180115 | 17
1 | HTTP| ^~�3�������������󬩵���粷�����������𶯰����ܬ�ï | 20180123 | 07
1 | HTTP | 5g | 20180123 | 09
1 | HTTP | `6$pct{z`ChagykbmsvDlbeu0)d&`{f/d80l18m`29VYei1&49dw1/g~fOvt!%3iv"3U;9(!>%4pfbbyn | 20180117 | 14
1 | HTTP | ^~!7c{cxg | 20180117 | 11
1 | HTTP | ^~89>0&9fjefdT\3=2&=86sgzd | 20180117 | 12
1 | HTTP | ^~8)rzk)+tar.8?0,%:?&3&<)>4.81;1#++(pqzwglgl:*fq05nfu13;1p17:g&hal5u?b<a&<bm`%++(cxnhzk`aj | 20180115 | 12
1 | HTTP | `a`ih$mmdzb | 20180117 | 17
1 | HTTP | ^~�a>mj[^RTYU\oe#WRNEH]C_D | 20180123 | 12
1 | HTTP | ^~Cookie:**** | 20180117 | 13
1 | HTTP | ^~Cookie:***�H�O��:��pd�����L]��Ie(���T��MT�(���� | 20180117 | 18
1 | HTTP | ^~Cookie:****N:^L:��4R�W0�{б�#��Z��r | 20180118 | 00
1 | HTTP | Rejection Reason": "Malformed line with incorrect number of fields (expected=35,actual=17) | 22974464 | 24
1 | HTTP | Rejection Reason": "Malformed line with incorrect number of fields (expected=35,actual=17) | 35905339 | 66
1 | HTTP | Rejection Reason": "Malformed line with incorrect number of fields (expected=35,actual=17) | 40861664 | 30
1 | HTTP | Rejection Reason": "Malformed line with incorrect number of fields (expected=35,actual=18) | 03727721 | 39
2 | HTTP | Rejection Reason": "Malformed line with incorrect number of fields (expected=35,actual=19) | 20170727 | 12
9 | HTTP | Rejection Reason": "Malformed line with incorrect number of fields (expected=35,actual=19) | 20180115 | 00

Tried gsub to eliminate but it is not working.

Code:
 awk -F '[|]' '{gsub(/^~*/,"",$3)}; {print $3}' filename

Please guide how should i handled the regex pattern strings.

Last edited by RudiC; 02-08-2018 at 03:42 AM.. Reason: Changed [PHP] to [CODE] tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED Search Pattern and Replace with the Pattern

Hello All, I have a string "CP_STATUS OSSRC_R6_0_Shipment_R1H_CU AOM_901046 R1H_LLSV1_2008031", and I just want to extract LLSV1, but I dont get the expected result when using the sed command below. # echo "CP_STATUS OSSRC_R6_0_Shipment_R1H_CU AOM_901046 R1H_LLSV1_2008031" | awk '{print... (4 Replies)
Discussion started by: racbern
4 Replies

2. Shell Programming and Scripting

perl:: search for tow pattern and replace the third pattern

Hi i want to search two pattern on same line and replace onther pattern.. INPut file aaaa bbbbb nnnnnn ttttt cccc bbbbb nnnnnn ppppp dddd ccccc nnnnnn ttttt ffff bbbbb oooooo ttttt now i want replace this matrix like.. i want search for "bbbbb","nnnnnn" and search and replace for... (4 Replies)
Discussion started by: nitindreamz
4 Replies

3. Shell Programming and Scripting

How to replace pattern

Hello EveryOne, I have a file "test" with following entry. this is test prtestad yes this is test . Above i have colored pr and ad . Actually requirement is to replace all words starts with pr and ends with ad should be replaced by word prahlad . Means after changes... (9 Replies)
Discussion started by: shirsha
9 Replies

4. Shell Programming and Scripting

How to replace anything before a pattern?

Hi, I have the following text file: facdat=$SPDR_SHARED_SCRIPTS/mdb_facdat.pl -s fnma; upddte=$AGENCY_SCRIPTS/get_upddte.pl -f $EMBS_DAILY_DIR/$filenm $SASRUN $AGENCY_SCRIPTS/fnma_daily_factors.sas -sysparm "$facdat $upddte" $SASRUN $AGENCY_SCRIPTS/fnma_daily_addtn.sas -sysparm "$facdat... (12 Replies)
Discussion started by: ramky79
12 Replies

5. Shell Programming and Scripting

replace pattern after the first pattern match

I need this. aaa OOOOO bbb ccc OOOOO ddd fff ggg OOOOO iii OOOOO I need all OOOOO replaced with PPPPP, but only change after the pattern ggg. So the first two OOOOO should not be changed. OUTPUT should be :- aaa (2 Replies)
Discussion started by: anilcliff
2 Replies

6. Shell Programming and Scripting

pattern match and replace another pattern in same line

I have a pattern username:x:32005:32006::/usr/local/user:/bin/bash I need to match the line containing username and replace /bin/bash with /usr/local/my/bin/noshell So it becomes username:x:32005:32006::/usr/local/user:/usr/local/my/bin/noshell (7 Replies)
Discussion started by: anilcliff
7 Replies

7. Shell Programming and Scripting

Linux: replace pattern with pattern

Hi, I am a rookie of Linux. I have a problem on how can I replace a certain pattern in Linux with nothing. Can anyone help me?:( sample.txt: <binding>App189 ABC SampleMachine1 ABC XXX YYY ZZZ </binding> <binding>App190 ABC SampleMachine2 ABC XXX YYY ZZZ </binding> <binding>App191... (3 Replies)
Discussion started by: dirkaulo
3 Replies

8. Shell Programming and Scripting

Replace pattern with new one

Hi, I have file as follows. And i want to remove {,} and ' from the line with :4488: to :-}. INPUT FILE :2020:WITCH13288008772 :4488:20131015INR250000,03 :5500:00000060020001752 {Mr. Chintan ' Add1} . { } Add2 :5518:WITC0000822 -} OUTPUT FILE :2020:WITCH13288008772... (10 Replies)
Discussion started by: sandipgawale
10 Replies

9. Shell Programming and Scripting

sed command to replace two character pattern with another pattern

Not able to paste my content. Please see the attachment :-( (2 Replies)
Discussion started by: vivek d r
2 Replies

10. Shell Programming and Scripting

Rearrange or replace only the second line after pattern match or pattern match

Im using the command below , but thats not the output that i want. it only prints the odd and even numbers. awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}' Im hoping for something like this file1: Text hi this is just a test text1 text2 text3 text4 text5 text6 Text hi... (2 Replies)
Discussion started by: invinzin21
2 Replies
CURLOPT_HTTP_VERSION(3) 				     curl_easy_setopt options					   CURLOPT_HTTP_VERSION(3)

NAME
CURLOPT_HTTP_VERSION - specify HTTP protocol version to use SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTP_VERSION, long version); DESCRIPTION
Pass version a long, set to one of the values described below. They ask libcurl to use the specific HTTP versions. This is not sensible to do unless you have a good reason. You have to set this option if you want to use libcurl's HTTP/2 support. Note that the HTTP version is just a request. libcurl will still prioritize to re-use an existing connection so it might then re-use a con- nection using a HTTP version you haven't asked for. CURL_HTTP_VERSION_NONE We don't care about what version the library uses. libcurl will use whatever it thinks fit. CURL_HTTP_VERSION_1_0 Enforce HTTP 1.0 requests. CURL_HTTP_VERSION_1_1 Enforce HTTP 1.1 requests. CURL_HTTP_VERSION_2_0 Attempt HTTP 2 requests. libcurl will fall back to HTTP 1.1 if HTTP 2 can't be negotiated with the server. (Added in 7.33.0) The alias CURL_HTTP_VERSION_2 was added in 7.43.0 to better reflect the actual protocol name. CURL_HTTP_VERSION_2TLS Attempt HTTP 2 over TLS (HTTPS) only. libcurl will fall back to HTTP 1.1 if HTTP 2 can't be negotiated with the HTTPS server. For clear text HTTP servers, libcurl will use 1.1. (Added in 7.47.0) CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE Issue non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade. It requires prior knowledge that the server supports HTTP/2 straight away. HTTPS requests will still do HTTP/2 the standard way with negotiated protocol version in the TLS handshake. (Added in 7.49.0) DEFAULT
CURL_HTTP_VERSION_NONE PROTOCOLS
HTTP EXAMPLE
TODO AVAILABILITY
Along with HTTP RETURN VALUE
Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_SSLVERSION(3), CURLOPT_HTTP200ALIASES(3), libcurl 7.54.0 May 01, 2016 CURLOPT_HTTP_VERSION(3)
All times are GMT -4. The time now is 11:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy