01-06-2012
Note that vgersh99's code assume that $2 of the filter file are all distincts...
(which is currently the case in the given example, but if your real filter file is bigger, you should then check that it also follow that rule)
This User Gave Thanks to ctsgnb For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need an assistance in file generation using awk, sed or anything...
I have a big file that i need to filter desired parts only. The objective is to select (and print) the report # having the string "apple" on 2 consecutive lines in every report. Please note that the "apple" line has a HEX... (1 Reply)
Discussion started by: apalex
1 Replies
2. Shell Programming and Scripting
I want to filter records in one of my file using AWK command (or anyother command). I am using the below code
awk -F@ '$1=="0003"&&"$2==20100402" print {$0}' $INPUT > $OUTPUT
I want to pass the 0003 and 20100402 values through a variable. How can I do this?
Any help is much... (1 Reply)
Discussion started by: gpaulose
1 Replies
3. Shell Programming and Scripting
I have file1
3049
3138
4672
22631
45324
112382
121240
125470
130289
186128
193996
194002
202776
228002
253221
273523
284601
284605
641858 (8 Replies)
Discussion started by: biomed
8 Replies
4. Shell Programming and Scripting
I have a main file:
...
17,466971 0,095185 17,562156 id 676
17,466971 0,096694 17,563665 id 677
17,466971 0,09816 17,565131 id 678
17,466971 0,099625 17,566596 id 679
17,466971 0,101091 17,568062 id 680
17,466971 0,016175 17,483146 id... (4 Replies)
Discussion started by: boblix
4 Replies
5. Shell Programming and Scripting
AWK Gurus,
data:
srvhcm01 AZSCI
srvhcm01 AZSDB
srvhcm01 BZSDB
srvhcm01 E2QDI31
srvhcm01 YPDCI
srvhcm01 YPDDB
srvhcm01 UV2FSCR
srvhcm01 UV2FSBI
srvhcm01 UV2FSXI
srvhcm01 UV2FSUC
srvhcm01 UV2FSEP
srvhcm01 UV2FSRE
srvhcm01 NASCI
srvhcm01 NASDB
srvhcm01 UV2FSSL
srvhcm01 UV2FSDI (7 Replies)
Discussion started by: rveri
7 Replies
6. Shell Programming and Scripting
Hi,
I would like extract some lines from file csv using awk , below the example:
I have the file test.csv with in content below.
FLUSSO;COD;DATA_LAV;ESITO
ULL;78;17/09/2013;OL
ULL;45;05/09/2013;Apertura
NP;45;13/09/2013;Riallineamento
ULLNP;78;17/09/2013;OL
NPG;14;12/09/2013;AperturaTK... (6 Replies)
Discussion started by: giankan
6 Replies
7. UNIX for Dummies Questions & Answers
Currently, I have a print filter that takes a text file, that convert it into PCL which then gets to a HP printer. This works.
Now I need to embedded a image file within the text file.
I'm able to convert the image file into PCL and I can cat both files together to into a single document... (1 Reply)
Discussion started by: chedlee88-1
1 Replies
8. Shell Programming and Scripting
In the below awk if I use the attached file as the input, I get no results for TCF4. However, if I just copy that line from the attached file and use that as input I get results for TCF4.
Basically the gene file is a 1 column list that is used to filter $8 of the attached file. When there is a... (9 Replies)
Discussion started by: cmccabe
9 Replies
9. Shell Programming and Scripting
The below awk will filter a list of 30,000 lines in the tab-delimited file. What I am having trouble with is adding a condition to SVTYPE=CNV
that will only print that line if CI= must be >.05 .
The other condition to add is if SVTYPE=Fusion, then in order to print that line
READ_COUNT must... (3 Replies)
Discussion started by: cmccabe
3 Replies
10. Shell Programming and Scripting
I have file and process it and provide clean output.
input file
Device Symmetrix Name : 000A4
Device Symmetrix Name : 000A5
Device Symmetrix Name : 000A6
Device Symmetrix Name : 000A7
Device Symmetrix Name : 000A8
Device Symmetrix Name : 000A9
Device Symmetrix Name ... (10 Replies)
Discussion started by: ranjancom2000
10 Replies
LEARN ABOUT PHP
stream_filter_prepend
STREAM_FILTER_PREPEND(3) 1 STREAM_FILTER_PREPEND(3)
stream_filter_prepend - Attach a filter to a stream
SYNOPSIS
resource stream_filter_prepend (resource $stream, string $filtername, [int $read_write], [mixed $params])
DESCRIPTION
Adds $filtername to the list of filters attached to $stream.
PARAMETERS
o $stream
- The target stream.
o $filtername
- The filter name.
o $read_write
- By default, stream_filter_prepend(3) will attach the filter to the read filter chain if the file was opened for reading (i.e.
File Mode: r, and/or +). The filter will also be attached to the write filter chain if the file was opened for writing (i.e. File
Mode: w, a, and/or +). STREAM_FILTER_READ, STREAM_FILTER_WRITE, and/or STREAM_FILTER_ALL can also be passed to the $read_write
parameter to override this behavior. See stream_filter_append(3) for an example of using this parameter.
o $params
- This filter will be added with the specified $params to the beginning of the list and will therefore be called first during
stream operations. To add a filter to the end of the list, use stream_filter_append(3).
RETURN VALUES
Returns a resource which can be used to refer to this filter instance during a call to stream_filter_remove(3).
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.1.0 | |
| | |
| | Prior to PHP 5.1.0, this function returns TRUE |
| | on success or FALSE on failure. |
| | |
+--------+---------------------------------------------------+
NOTES
Note
When using custom (user) filters
stream_filter_register(3) must be called first in order to register the desired user filter to $filtername.
Note
Stream data is read from resources (both local and remote) in chunks, with any unconsumed data kept in internal buffers. When a new
filter is prepended to a stream, data in the internal buffers, which has already been processed through other filters will not be
reprocessed through the new filter at that time. This differs from the behavior of stream_filter_append(3).
Note
When a filter is added for read and write, two instances of the filter are created. stream_filter_prepend(3) must be called twice
with STREAM_FILTER_READ and STREAM_FILTER_WRITE to get both filter resources.
SEE ALSO
stream_filter_register(3), stream_filter_append(3).
PHP Documentation Group STREAM_FILTER_PREPEND(3)