Sponsored Content
Full Discussion: Filter a particular string
Top Forums UNIX for Dummies Questions & Answers Filter a particular string Post 302650603 by vanand420 on Monday 4th of June 2012 02:27:54 AM
Old 06-04-2012
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 :
Code:
+++ 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 ++-

+++ ELEMENT 12-05-27 23:15:56 CC 3482 #040187 >
 REPT APB TPE=C7NTL   SM=22  OPC=4-003-7   APC=4-033-0  inaccessible
 END OF REPORT #040187 ++-

+++ ELEMENT 12-05-27 23:16:26 CC 3482 #040188 >
 REPT APB TPE=C7NTL   SM=22  OPC=4-003-7   APC=4-033-6  inaccessible
 END OF REPORT #040188 ++-

Output :
Code:
OPC=4-003-7   APC=4-033-0  inaccessible 12-05-27 23:15:56

Thanks in advance.

Last edited by Scrutinizer; 06-04-2012 at 03:52 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Filter some text

Dear experts, Below i have mentioned two alarms with MAJOR severity, i am intrested only with alarm contains text tre , actually i want to filter out alarm which is highlighted in bold text in some other file for further processing. I need all above three line of the alarm containing text tre... (3 Replies)
Discussion started by: Danish Shakil
3 Replies

3. 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

4. Shell Programming and Scripting

How to filter

Hi I have a file containing the below lines 1010001001639 1010001001789 1020001001927 1030001001928 1040001002033 1200001002609 1200001003481 1200001004935 I need to filter lines that starts with 101. It would be of great help if its in awk. (6 Replies)
Discussion started by: Naga06
6 Replies

5. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

6. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

7. Shell Programming and Scripting

Perl script to filter the string

Hi folks, I have a log file with the lines in the below format. 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., ... (1 Reply)
Discussion started by: scriptscript
1 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. UNIX for Dummies Questions & Answers

Filter records in a huge text file from a filter text file

Hi Folks, I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file. bash scripting is what i need. Data.txt Name OrderID Quantity Sam 123 300 Jay 342 498 Kev 78 2500 Sam 420 50 Vic 10... (3 Replies)
Discussion started by: tech_frk
3 Replies

10. 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
APC_CACHE_INFO(3)							 1							 APC_CACHE_INFO(3)

apc_cache_info - Retrieves cached information from APC's data store

SYNOPSIS
array apc_cache_info ([string $cache_type = ""], [bool $limited = false]) DESCRIPTION
Retrieves cached information and meta-data from APC's data store. PARAMETERS
o $cache_type - If $cache_type is " user", information about the user cache will be returned. If $cache_type is " filehits", information about which files have been served from the bytecode cache for the current request will be returned. This feature must be enabled at compile time using --enable-filehits. If an invalid or no $cache_type is specified, information about the system cache (cached files) will be returned. o $limited - If $limited is TRUE, the return value will exclude the individual list of cache entries. This is useful when trying to optimize calls for statistics gathering. RETURN VALUES
Array of cached data (and meta-data) or FALSE on failure Note apc_cache_info(3) will raise a warning if it is unable to retrieve APC cache data. This typically occurs when APC is not enabled. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ |3.0.11 | | | | | | | The $limited parameter was introduced. | | | | |3.0.16 | | | | | | | The " filehits" option for the $cache_type | | | parameter was introduced. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 A apc_cache_info(3) example <?php print_r(apc_cache_info()); ?> The above example will output something similar to: Array ( [num_slots] => 2000 [ttl] => 0 [num_hits] => 9 [num_misses] => 3 [start_time] => 1123958803 [cache_list] => Array ( [0] => Array ( [filename] => /path/to/apc_test.php [device] => 29954 [inode] => 1130511 [type] => file [num_hits] => 1 [mtime] => 1123960686 [creation_time] => 1123960696 [deletion_time] => 0 [access_time] => 1123962864 [ref_count] => 1 [mem_size] => 677 ) [1] => Array (...iterates for each cached file) ) SEE ALSO
APC configuration directives, APCIterator::getTotalSize, APCIterator::getTotalHits, APCIterator::getTotalCount. PHP Documentation Group APC_CACHE_INFO(3)
All times are GMT -4. The time now is 09:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy