Sponsored Content
Top Forums Shell Programming and Scripting Please help! Sed extract a pattern Post 302088926 by sayonm on Friday 15th of September 2006 06:21:46 AM
Old 09-15-2006
Quote:
Originally Posted by ghostdog74
hi , can i clarify , you just want to get "securitySettings" from a line and then assign the value "securitySettings" to a variable called "name" ?

I think i am missing something...
he doesnt want to search for securitySettings. Instead he wants to search the word "localhost" and find the last part of that link(href as in a html tag)...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract a string after a pattern using sed

I have a very large file and each line has a pattern and it is not position specific. I need to extract the string after the pattern ****MI* is the pattern in the red color 12 digit number is the sting value in the green color and it ends with ~ e.g. ... (1 Reply)
Discussion started by: gunaah
1 Replies

2. Shell Programming and Scripting

sed: Find start of pattern and extract text to end of line, including the pattern

This is my first post, please be nice. I have tried to google and read different tutorials. The task at hand is: Input file input.txt (example) abc123defhij-E-1234jslo 456ujs-W-abXjklp From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies

3. Shell Programming and Scripting

Search for a pattern,extract value(s) from next line, extract lines having those extracted value(s)

I have hundreds of files to process. In each file I need to look for a pattern then extract value(s) from next line and then search for value(s) selected from point (2) in the same file at a specific position. HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V TITLE CYTOCHROME... (7 Replies)
Discussion started by: AshwaniSharma09
7 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Extract a pattern using sed or cut

Hi, Need help to extract a pattern using sed or cut or any other means. Input 'name1',1234567890 'name2',2222222222 'name3',3333333333 Expected output name1,1234567890 name2,2222222222 name3,3333333333 (3 Replies)
Discussion started by: mukulverma2408
3 Replies

5. Shell Programming and Scripting

How to use sed to search a particular pattern in a file backward after a pattern is matched.?

Hi, I have two files file1.txt and file2.txt. Please see the attachments. In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Discussion started by: saurabh kumar
9 Replies

6. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

7. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

8. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

9. Shell Programming and Scripting

[sed] Finding and sticking the pattern to the beginning of successive lines up to the next pattern

I have a file like below. 2018.07.01, Sunday 09:27 some text 123456789 0 21 0.06 0.07 0.00 2018.07.02, Monday 09:31 some text 123456789 1 41 0.26 0.32 0.00 09:39 some text 456789012 1 0.07 0.09 0.09 09:45 some text 932469494 1 55 0.29 0.36 0.00 16:49 some text 123456789 0 48 0.12 0.15 0.00... (9 Replies)
Discussion started by: father_7
9 Replies

10. Shell Programming and Scripting

Extract whole word preceding a specific character pattern with first occurence of the pattern

Hello. Here is a file contents : declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern =I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '=' Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies
FILTER_INPUT(3) 							 1							   FILTER_INPUT(3)

filter_input - Gets a specific external variable by name and optionally filters it

SYNOPSIS
mixed filter_input (int $type, string $variable_name, [int $filter = FILTER_DEFAULT], [mixed $options]) DESCRIPTION
PARAMETERS
o $type - One of INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV. o $variable_name - Name of a variable to get. o $filter - The ID of the filter to apply. The "Types of filters" manual page lists the available filters. If omitted, FILTER_DEFAULT will be used, which is equivalent to FILTER_UNSAFE_RAW. This will result in no filtering taking place by default. o $options - Associative array of options or bitwise disjunction of flags. If filter accepts options, flags can be provided in "flags" field of array. RETURN VALUES
Value of the requested variable on success, FALSE if the filter fails, or NULL if the $variable_name variable is not set. If the flag FIL- TER_NULL_ON_FAILURE is used, it returns FALSE if the variable is not set and NULL if the filter fails. EXAMPLES
Example #1 A filter_input(3) example <?php $search_html = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_SPECIAL_CHARS); $search_url = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_ENCODED); echo "You have searched for $search_html. "; echo "<a href='?search=$search_url'>Search again.</a>"; ?> The above example will output something similar to: You have searched for Me &#38; son. <a href='?search=Me%20%26%20son'>Search again.</a> SEE ALSO
filter_var(3), filter_input_array(3), filter_var_array(3), "Types of filters". PHP Documentation Group FILTER_INPUT(3)
All times are GMT -4. The time now is 04:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy