Sponsored Content
Top Forums Shell Programming and Scripting display content between all similar tags pattern Post 302362969 by therockravi on Monday 19th of October 2009 04:27:15 AM
Old 10-19-2009
I tried
code:
Code:
@arr=($content =~ m{<div class="abs\c">(.*?)</div>}g);
print @arr;

but when i try putting s instead of g it print the content inside first occuring <div> tags pair in $content..

i still could not figure out the problem...

---------- Post updated at 03:02 AM ---------- Previous update was at 03:00 AM ----------

Code:
@arr=($content =~ m{<div class="abs\c">(.*?)</div>}g);
print @arr;

its not working

---------- Post updated at 03:27 AM ---------- Previous update was at 03:02 AM ----------

I got the it..!!!! jsst put s and g together... as...

Code:
@arr=($content =~ m{<div class="abs\c">(.*?)</div>}sg);
print @arr;

 

9 More Discussions You Might Find Interesting

1. Linux

Command that prints content of line5, or similar?

Hello all; I've been having trouble completing a script (bash) because I can't get past the issue of finding a line in a file. For example, I have a file like this: ddmmmyyyy Lon Lat 24may2003 -100.0 24.1 25may2003 -100.1 24.0 28may2003 -99.5 23.2 ....etc... (4 Replies)
Discussion started by: lunchtime
4 Replies

2. Shell Programming and Scripting

Want to grep for a pattern and display the content above that pattern

Hi, When we have a failure, sometimes we just step restart the job from the next step. Later when we open the log for analysis of the failure, it is becoming difficult to go to the failure part. For eg., if it is a 1000 line log, the failure may be at 500th line. so wat i want to do is, grep... (6 Replies)
Discussion started by: ajayakunuri
6 Replies

3. UNIX for Dummies Questions & Answers

merge lines within a file that start with a similar pattern

Hello! i have a text file.. which contains the data as follows i want to merge the declarations lines pertaining to one datatype in to a single line as follows i've searched the forum for help.. but couldn't find much help.. how can i do this?? (1 Reply)
Discussion started by: a_ba
1 Replies

4. Shell Programming and Scripting

Help with merge two file based on similar column content

Input file 1: A1BG A1BG A1BG A1CF A1CF BCAS BCAS A2LD1 A2M A2M HAT . . Input file 2: A1BG All A1CF TEMP (5 Replies)
Discussion started by: perl_beginner
5 Replies

5. Shell Programming and Scripting

awk to search similar strings and arrange in a specified pattern

Hi, I'm running a DB query which returns names of people and writes it in a text file as shown below: Carey, Jim; Cena, John Cena, John Sen, Tim; Burt, Terrence Lock, Jessey; Carey, Jim Norris, Chuck; Lee, Bruce Rock, Dwayne; Lee, Bruce I want to use awk and get all the names... (9 Replies)
Discussion started by: prashu_g
9 Replies

6. UNIX for Dummies Questions & Answers

Find next line based on pattern, if it is similar pattern skip it

Hi, I am able to get next line if it is matching a particular pattern. But i need a way to skip if next line also matches same pattern.. For example: No Records No Records Records found got it Records found Now i want to find 'Records found' after 'No Records' pattern matches.. ... (5 Replies)
Discussion started by: nagpa531
5 Replies

7. Shell Programming and Scripting

Join all the lines matching similar pattern

I am trying to Join all the lines matching similar pattern. Example ; I wanted to join all the lines which has sam to a single line. In next line, i wanted to have all the lines with jones to a single line....etc > cat sample.txt sam 2012/11/23 sam 2012/12/5 sam 2012/12/5 jones... (2 Replies)
Discussion started by: evrurs
2 Replies

8. UNIX for Dummies Questions & Answers

Crunch character combination and discard similar content

Hi guys ! I generated the power set of the set S={a,b,c} using crunch: crunch 1 3 abc and get the 39 possible subsets: a b c aa ab ac ba bb bc ca cb cc … (2 Replies)
Discussion started by: beca123456
2 Replies

9. Shell Programming and Scripting

Fetch lines between 1st and 4th similar pattern

Hi Folks, I have a big file that looks like below ========== kjhjl kjlklkkhcgflj fgf ========== xsww23edc ccdde3rfv ceerfcc vff4 ========== zaq12wsx xsw23edc ========== ========== (3 Replies)
Discussion started by: jayadanabalan
3 Replies
CURRENT(3)								 1								CURRENT(3)

current - Return the current element in an array

SYNOPSIS
mixed current (array &$array) DESCRIPTION
Every array has an internal pointer to its "current" element, which is initialized to the first element inserted into the array. PARAMETERS
o $array - The array. RETURN VALUES
The current(3) function simply returns the value of the array element that's currently being pointed to by the internal pointer. It does not move the pointer in any way. If the internal pointer points beyond the end of the elements list or the array is empty, current(3) returns FALSE. Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. EXAMPLES
Example #1 Example use of current(3) and friends <?php $transport = array('foot', 'bike', 'car', 'plane'); $mode = current($transport); // $mode = 'foot'; $mode = next($transport); // $mode = 'bike'; $mode = current($transport); // $mode = 'bike'; $mode = prev($transport); // $mode = 'foot'; $mode = end($transport); // $mode = 'plane'; $mode = current($transport); // $mode = 'plane'; $arr = array(); var_dump(current($arr)); // bool(false) $arr = array(array()); var_dump(current($arr)); // array(0) { } ?> NOTES
Note You won't be able to distinguish the end of an array from a boolean FALSE element. To properly traverse an array which may contain FALSE elements, see the each(3) function. SEE ALSO
end(3), key(3), each(3), prev(3), reset(3), next(3). PHP Documentation Group CURRENT(3)
All times are GMT -4. The time now is 06:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy