Sponsored Content
Top Forums Shell Programming and Scripting Perl script to filter the string Post 302833267 by scriptscript on Tuesday 16th of July 2013 04:24:56 PM
Old 07-16-2013
Perl script to filter the string

Hi folks,

I have a log file with the lines in the below format.

Code:
Jul  1 23:00:51 10.212.3.251 SS: %SYS-7-CLI_SCHEDULE:  some error occured

I want to split the line based on the " %SYS-7-CLI_SCHEDULE: " value.
The criteria is the should store the word that starts with % i.e., %SYS-7-CLI_SCHEDULE:

now

$left should contain Jul 1 23:00:51 10.212.3.251 SS:
$matched should contain %SYS-7-CLI_SCHEDULE:
$right should contain some error

Could anyone please help with the perl script with regular expression to get out of this.

Thanks in advance ....


Regards,
J
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl script to filter logfile

i was wondering if anyone can help me, how could i write in perl a a script that would look through a log file and print onscreen the contents of the log file excluding lines that contain '192.168.1.' and entries that contain directory paths that arent in the directory /usr/local/httpd/htdocs/ i... (4 Replies)
Discussion started by: norsk hedensk
4 Replies

2. Shell Programming and Scripting

String replace perl script error

I have written down a simple perl program to replace a string from a word file. My script does'nt seem to work. Any pointers to make it work will be appreciated. The code is given below. #!/usr/bin/perl while (<>) { open(FILE,$_); while (<FILE>) { s/This/I did it/g; }... (6 Replies)
Discussion started by: MobileUser
6 Replies

3. Shell Programming and Scripting

filter the string from a file ??

I have a file in which there are strings given below: inode 1138932c(mqsiadm) inode 1257904c(mqsiadm) I want to get the nos. only form these. The o/p should be 1138932 1257904 How to filter this out ?? (11 Replies)
Discussion started by: varungupta
11 Replies

4. Shell Programming and Scripting

Sed filter words from string

I have following string in a variable: str="sstring garbage adfsdf tab.col1 lkad rjfj tab2.col2 adja tab2.col4 garbage" I want to filter "word.word" pattern from it. I assume the pattern won't occur in start or end of the string. Output shoud be: tab.col1 tab2.col2 tab2.col4 Can this be... (7 Replies)
Discussion started by: amicon007
7 Replies

5. Shell Programming and Scripting

Displaying exponent value as string in PERL script

Hello All, I am currently having an issue displaying a exponent value using perl, I have a perl program which generates an xls file. This xls is populated with values from a database. But for a certain column which I have made explicitely text and also implemented keep_leading_zeroes()... (3 Replies)
Discussion started by: sbasetty
3 Replies

6. Shell Programming and Scripting

Perl script - Help me extracting a string

I have input like this : TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 07-FEB-2012 04:19:45 Copyright (c) 1997, 2009, Oracle. All rights reserved. Used parameter files: /t3local_apps/apps/oracle/product/11.2.0/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve... (3 Replies)
Discussion started by: dnam9917
3 Replies

7. UNIX for Dummies Questions & Answers

Filter a particular string

Hi, I have a long log file. Out of which I want to filter particular occurrences where APC=4-033-0. Please help how it can be done. Input : +++ ELEMENT 12-05-27 23:15:06 CC 3482 #040185 > REPT APB TPE=C7NTL SM=22 OPC=4-003-7 APC=4-033-4 inaccessible END OF REPORT #040185 ++- ... (7 Replies)
Discussion started by: vanand420
7 Replies

8. Shell Programming and Scripting

Shell Script (ksh) - SQLPlus query filter using a string variable

Using ksh, I am using SQLPlus to execute a query with a filter using a string variable. REPO_DB=DEV1 FOLDER_NM='U_nmalencia' FOLDER_CHECK=$(sqlplus -s /nolog <<EOF CONNECT user/pswd_select@${REPO_DB} set echo off heading off feedback off select subj_name from subject where... (5 Replies)
Discussion started by: nkm0brm
5 Replies

9. Shell Programming and Scripting

Need to filter string between specific string in ksh

My argument has data as below. 10.9.9.85 -rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538 -rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr56scr 127869538 ....... (note all these between lines will start with hyphen '-' ) -rwxr-xr-x user1 2019-10-15 17:40... (3 Replies)
Discussion started by: mohtashims
3 Replies
UG(4)							   BSD Kernel Interfaces Manual 						     UG(4)

NAME
ug -- Abit uGuru system hardware monitor SYNOPSIS
ug* at acpi? ug0 at isa? port 0xe0 DESCRIPTION
The ug driver provides support for the Abit uGuru hardware monitor to be used with the envsys(4) interface. The ug driver has 19 sensors: Sensor Units Typical Use CPU uK CPU Temp SYS uK System Temp PWN uK PWN Temp VCORE uV DC Core voltage DDR0 uV DC DDRVdd DDR1 uV DC DDRVtt NB uV DC NBVdd SB uV DC SBVdd HTV uV DC HTVdd AGP uV DC AGPVdd V5V uV DC Vdd5V V33V uV DC Vdd3V3 V5SB uV DC Vdd5VSB V33VD uV DC Vdd3VDual CPUF RPM CPU Fan NBF RPM NB Fan SYSF RPM SYS Fan AUXF RPM AUX Fan 1 AUXF2 RPM AUX Fan 2 SEE ALSO
acpi(4), envsys(4), envstat(8) HISTORY
The ug driver first appeared in NetBSD 4.0. AUTHORS
The ug driver was written by Mihai Chelaru <kefren@netbsd.ro>. BUGS
Interrupt support is unimplemented. BSD
May 8, 2007 BSD
All times are GMT -4. The time now is 01:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy