i can only find the first occurance of a pattern how do i set it to loop untill all occurances have changed.
#! /usr/bin/perl
use POSIX;
open (DFH_FILE, "./dfh") or die "Can not read file ($!)";
foreach (<DFH_FILE>) {
if ($_ !~ /^#|^$/) {
chomp;
... (1 Reply)
hi i am trying to get digits inside brackes from file , whose structure is defined below
CREATE TABLE TELM
(SOC_NO CHAR (3) NOT NULL,
TXN_AMOUNT NUMBER (17,3)
SIGN_ON_TIME CHAR (8)
TELLER_APP_LIMIT NUMBER (17,3)
FIL01 ... (2 Replies)
Hello
I got the below one from in one of this forums
For Ex: Loading File System Networking in nature
now i need to extract the patterns between the words File and Networking :
i.e. sample output: System
cmd used : cat <file> | sed 's/.*File //' | sed 's/Closing.*$//'
Actually... (0 Replies)
Hi,
I got doubt in Pattern matching, could you tell me how the following differs in action ??
if ( $line1==/$line2/ )
if ( $line1=~/$line2/ )
if ( $line1=~m/$line2/)
What is the significance of '~' in matching.
Thanks in advance
CoolBhai (5 Replies)
Hello experts,
I have a file containing the following text(shortened here).
File Begin
----------
< # Billboard.d3fc1302a677.imagePath=S:\\efcm_T4
< Billboard.d3fc1302a677.imagePath=S:\\efcm_T4
---
> # Billboard.d3fc1302a677.imagePath=S:\\efcm_Cassini
>... (2 Replies)
I am doing a file patterhn matching for a text file in PERL
I am using this,,, but it says that no file is found
$filepattern = '\d{1,4}.*A0NW9693.NDM.HBIDT.*.AD34XADJ.txt';
Can anyone help me out with Perl Pattern Matching concepts and how to do pattern matching for this txt file:... (4 Replies)
I have a 2 files in .gz format and it consists of 5 million lines the format of the file would be
gzcat file1.gz | more
abcde
aerere
ffgh56
..
..
12345
gzcat file2.gz | more
abcde , 12345 , 67890,
ffgh56 , 45623 ,12334
whatever the string is in the file1 should be matched... (3 Replies)
My log file looks as given below, its actually a huge file around 1 GB and these are some of the line:
conn=5368758 op=10628050 msgId=64 - RESULT err=0 tag=101 nentries=1 etime=0
conn=7462122 op=-1 msgId=-1 - fd=247 slot=247 LDAPS connection from 10.13.18.12:37645 to 10.18.6.45
conn=7462122... (5 Replies)
Hi,
I have a list of IP, eg :
192.168.0.15
192.168.0.24
192.168.2.110
192.168.2.200
And I would like the shortest pattern who match with '192.168.0' and '192.168.2' (without the last dot and number). (7 Replies)
I am using Perl version 5.8.4 and trying to understand the use of regular expression. Following is my code and output.
$string = "Perl is a\nScripting language";
($start) = ($string =~ /\A(.*?) /);
@lines = ($string =~ /^(.*?) /gm);
print "First Word (using \\A): $start\n","Line... (4 Replies)
Discussion started by: jnrohit2k
4 Replies
LEARN ABOUT SUNOS
touchline
is_linetouched(3XCURSES) X/Open Curses Library Functions is_linetouched(3XCURSES)NAME
is_linetouched, is_wintouched, touchline, touchwin, untouchwin, wtouchln - control window refresh
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
bool is_linetouched(WINDOW *win, int line);
bool is_wintouched(WINDOW *win);
int touchline(WINDOW *win, int start, int count);
int touchwin(WINDOW *win);
int untouchwin(WINDOW *win);
int wtouchln(WINDOW *win, int y, int n, int changed);
PARAMETERS
win Is a pointer to the window in which the refresh is to be controlled or monitored.
line Is the line to be checked for change since refresh.
start Is the starting line number of the portion of the window to make appear changed.
count Is the number of lines in the window to mark as changed.
y Is the starting line number of the portion of the window to make appear changed or not changed.
n Is the number of lines in the window to mark as changed.
changed Is a flag indicating whether to make lines look changed(0) or not changed(1).
DESCRIPTION
The touchwin() function marks the entire window as dirty. This makes it appear to X/Open Curses as if the whole window has been changed,
thus causing the entire window to be rewritten with the next call to refresh(3XCURSES). This is sometimes necessary when using overlapping
windows; the change to one window will not be reflected in the other and, hence will not be recorded.
The touchline() function marks as dirty a portion of the window starting at line start and continuing for count lines instead of the entire
window. Consequently, that portion of the window is updated with the next call to refresh().
The untouchwin() function marks all lines in the window as unchanged since the last refresh, ensuring that it is not updated.
The wtouchln() function marks n lines starting at line y as either changed (changed=1) or unchanged (changed=0) since the last refresh.
To find out which lines or windows have been changed since the last refresh, use the is_linetouched() and is_wintouched() functions,
respectively. These return TRUE if the specified line or window have been changed since the last call to refresh() or FALSE if no changes
have been made.
RETURN VALUES
On success, these functions return OK. Otherwise, they return ERR.
ERRORS
None.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO doupdate(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5)SunOS 5.10 5 Jun 2002 is_linetouched(3XCURSES)