Sponsored Content
Top Forums Shell Programming and Scripting Print last occurrence if first field match Post 302146030 by Raynon on Friday 16th of November 2007 08:59:38 AM
Old 11-16-2007
Thanks vgersh99!! Smilie
Thanks for your guidance!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to Match first field of two Files and print

Hi, I want to get script or command in Sun Unix which matches first fields of both the files and print the feilds of one files, example may make it more clear. InputFile1 ================== Alex,1,fgh Menthos,45454,toto Gothica,855,ee Zenie4,77,gg Salvatore,66,oo Dhin,1234,papapa... (3 Replies)
Discussion started by: indian.ace
3 Replies

2. Shell Programming and Scripting

last occurrence of a match through multiple files

Hi all, I have a lot of files with extension ".o" and I would like to extract the 10th line after (last) occurrence of a given string in each of the files. I tried: $ grep "string_to_look_for" *.o -A 10 | tail -1 but it gives the occurrence in the last file with extension .o ... (1 Reply)
Discussion started by: f_o_555
1 Replies

3. Shell Programming and Scripting

sed print from last occurrence match until the end of file

Hi, i have file f1.txt with data like: CHECK a b CHECK c d CHECK e f JOB_START .... I want to match the last occurrence of 'CHECK' until the end of the file. I can use awk: awk '/^CHECK/ { buf = "" } { buf = buf "\n" $0 } END { print buf }' f1.txt | tail +2Is there a cleaner way of... (2 Replies)
Discussion started by: ysrini
2 Replies

4. UNIX for Dummies Questions & Answers

Match pattern in a field, print pattern only instead of the entire field

Hi ! I have a tab-delimited file, file.tab: Column1 Column2 Column3 aaaaaaaaaa bbtomatoesbbbbbb cccccccccc ddddddddd eeeeappleseeeeeeeee ffffffffffffff ggggggggg hhhhhhtomatoeshhh iiiiiiiiiiiiiiii ... (18 Replies)
Discussion started by: lucasvs
18 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Replace first occurrence after match

hey guys, i have been trying to work this thing out with sed with no luck :confused: i m looking for a way to replace only the first occurrence after a match for example : Cat Realized what you gotta do Dog Realized what you gotta do Sheep Realized what you gotta do Wolf Realized... (6 Replies)
Discussion started by: boaz733
6 Replies

6. Shell Programming and Scripting

Egrep - Only Match First Occurrence

echo 'String#1 and String#2' | egrep -o -m 1 'String#.{1}' String#1 String#2 I'm trying to just match the first occurrence of 'String#' + 1 character. I thought the "-m 1" switch would do that for me. Instead I get both occurrences. Can somebody provide some insight? Thanks! (5 Replies)
Discussion started by: sudo
5 Replies

7. Shell Programming and Scripting

Match columns and print specific field

Hello, I have data in following format. ... (6 Replies)
Discussion started by: Pushpraj
6 Replies

8. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

9. Shell Programming and Scripting

sed print from last occurrence match until the end of last occurrence match

Hi, i have file file.txt with data like: START 03:11:30 a 03:11:40 b END START 03:13:30 eee 03:13:35 fff END jjjjjjjjjjjjjjjjjjjjj START 03:14:30 eee 03:15:30 fff END ggggggggggg iiiiiiiiiiiiiiiiiiiiiiiii I want the below output START (13 Replies)
Discussion started by: Jyotshna
13 Replies

10. Shell Programming and Scripting

awk to print text in field if match and range is met

In the awk below I am trying to match the value in $4 of file1 with the split value from $4 in file2. I store the value of $4 in file1 in A and the split value (using the _ for the split) in array. I then strore the value in $2 as min, the value in $3 as max, and the value in $1 as chr. If A is... (6 Replies)
Discussion started by: cmccabe
6 Replies
MPSImageGuidedFilter(3) 				 MetalPerformanceShaders.framework				   MPSImageGuidedFilter(3)

NAME
MPSImageGuidedFilter SYNOPSIS
#import <MPSImageGuidedFilter.h> Inherits MPSKernel. Instance Methods (nonnull instancetype) - initWithDevice:kernelDiameter: (nonnull instancetype) - initWithDevice: (nullable instancetype) - initWithCoder:device: (void) - encodeRegressionToCommandBuffer:sourceTexture:guidanceTexture:weightsTexture:destinationCoefficientsTexture: (void) - encodeReconstructionToCommandBuffer:guidanceTexture:coefficientsTexture:destinationTexture: Properties NSUInteger kernelDiameter float epsilon float reconstructScale float reconstructOffset Additional Inherited Members Detailed Description MPSImageGuidedFilter.h MetalPerformanceShaders Copyright: Copyright (c) 2018 Apple Inc. All rights reserved. MetalPerformanceShaders guided filter Perform Guided Filter to produce a coefficients image The filter is broken into two stages: o Regression o Reconstruction The regression stage learns a 4-channel 'coefficient' texture (typically at a very low resolution), and represents the per-pixel linear regression of the source texture to the guidance texture. The reconstruction stage upsamples the coefficeints to the same size as the final output and then at each pixel computes the inner product to produce the output. The filter is broken into two stages to allow coefficients to be filtered (such as for example - temporally filtering for video to prevent flicker). There is also support for an optional weight texture that can be used to discard values in the source data. Guided Filter is described at http://kaiminghe.com/publications/eccv10guidedfilter.pdf. Method Documentation - (void) encodeReconstructionToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull id< MTLTexture >) guidanceTexture(nonnull id< MTLTexture >) coefficientsTexture(nonnull id< MTLTexture >) destinationTexture Perform Guided Filter Reconstruction (inference) to produce the filtered output The filter will not begin to execute until after the command buffer has been enqueued and committed. sourceGuidanceTexture Input guidance pixel buffer. This should be a color (RGB) image. coefficientsTexture Input coefficients texture generated generated by a previous encodeRegressionToCommandBuffer Parameters: destinationTexture Output texture Note: The coefficients are upsampled at the reconstruction of the filtered data. Reconstruct(guidance RGB) = a.r * R + a.g * G + a.b * B + b, where a and b are the coefficients learnt using encodeRegressionToCommandBuffer. Final reconstructed value = value * reconstructScale + reconstructOffset - (void) encodeRegressionToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(nonnull id< MTLTexture >) sourceTexture(nonnull id< MTLTexture >) guidanceTexture(nullable id< MTLTexture >) weightsTexture(nonnull id< MTLTexture >) destinationCoefficientsTexture Perform Guided Filter Regression (correlation) to produce a coefficients texture The filter will not begin to execute until after the command buffer has been enqueued and committed. Parameters: commandBuffer A valid MTLCommandBuffer. sourceTexture Input source texture to be filtered (typically a mask). This should be a single channel image. guidanceTexture Input guidance texture. This should be a color (RGB) image. weightsTexture Optional input confidence texture. This should also a single channel image. destinationCoefficientsTexture Output texture with four coefficients that minimize the mean squared error between the source and an affine function of guidance R, G, B. Note: The destinationCoefficientsTexture computes the linear cofficients 'a' and 'b'. The 'a' coefficient is stored in the RGB channels of destinationCoefficientsTexture and the 'b' coefficient in the alpha chnanel. Set the MPSKernelOptionsAllowReducedPrecision in the 'options' property for this kernel to peform the computations using half-precision arithmetic. This can potentially improve performance and/or power usage. - (nullable instancetype) initWithCoder: (NSCoder *__nonnull) aDecoder(nonnull id< MTLDevice >) device NSSecureCoding compatability While the standard NSSecureCoding/NSCoding method -initWithCoder: should work, since the file can't know which device your data is allocated on, we have to guess and may guess incorrectly. To avoid that problem, use initWithCoder:device instead. Parameters: aDecoder The NSCoder subclass with your serialized MPSKernel device The MTLDevice on which to make the MPSKernel Returns: A new MPSKernel object, or nil if failure. Reimplemented from MPSKernel. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device Standard init with default properties per filter type Parameters: device The device that the filter will be used on. May not be NULL. Returns: a pointer to the newly initialized object. This will fail, returning nil if the device is not supported. Devices must be MTLFeatureSet_iOS_GPUFamily2_v1 or later. Reimplemented from MPSKernel. - (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(NSUInteger) kernelDiameter Specifies information to apply the guided filter regression. Parameters: device The device the filter will run on kernelDiameter The local window size Returns: A valid MPSImageGuidedFilterRegression object or nil, if failure. Property Documentation - epsilon [read], [write], [nonatomic], [assign] The regularization parameter The parameter used when computing the linear coefficients a and b. - kernelDiameter [read], [nonatomic], [assign] The local window size The local window size. - reconstructOffset [read], [write], [nonatomic], [assign] The offset parameter The offset parameter added to the result of the scaled reconstructed value. The default value is 0.0f. - reconstructScale [read], [write], [nonatomic], [assign] The scale parameter The parameter used to scale the result of the reconstruction operation. The default value is 1.0f. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSImageGuidedFilter(3)
All times are GMT -4. The time now is 06:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy