Sponsored Content
Top Forums Shell Programming and Scripting fuzzy sequence match in a text file Post 302700027 by Chubler_XL on Wednesday 12th of September 2012 09:35:35 PM
Old 09-12-2012
Apologies, this site seem focused on smallest number of chars, not clarity.

Code:
if(skip != 0 || $2+0 == day + 2) skip=1
 
# or
if (skip == 0) {
    if ($2+0 == day + 2) skip =1
}

Code:
if(skip ==0) max=day+2 else max=day+1


Last edited by Chubler_XL; 09-12-2012 at 10:41 PM..
This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

Fuzzy Match Logic for Numerical Values

I have searched the internet (including these forums) and perhaps I'm not using the right wording. What I'm looking for is a function (preferably C) that analyzes the similitude of two numerical or near-numerical values, and returns either a true/false (match/nomatch) or a return code that... (4 Replies)
Discussion started by: marcus121
4 Replies

2. Shell Programming and Scripting

match text from two files and write to a third file

Hi all I have two files X.txt and Y.txt. Both file contains same number of sentences. The content of X.txt is The filter described above may be combined. and the content of Y.txt is The filter describ+ed above may be combin+ed. Some of the words are separated with "+"... (2 Replies)
Discussion started by: my_Perl
2 Replies

3. Shell Programming and Scripting

Insert text file only after the first match with SED

Hello, I'm new in Shell scripting but i should write a script, which inserts the license header out of a txt-File into the files in our Projekt. For the Java classes it runs without Problems but for XML files not. At xml-files i have to put the license Header after the xml-Header (?xml... (1 Reply)
Discussion started by: PhoenixONE
1 Replies

4. Shell Programming and Scripting

find common entries and match the number with long sequence and cut that sequence in output

Hi all, I have a file like this ID 3BP5L_HUMAN Reviewed; 393 AA. AC Q7L8J4; Q96FI5; Q9BQH8; Q9C0E3; DT 05-FEB-2008, integrated into UniProtKB/Swiss-Prot. DT 05-JUL-2004, sequence version 1. DT 05-SEP-2012, entry version 71. FT COILED 59 140 ... (1 Reply)
Discussion started by: manigrover
1 Replies

5. Shell Programming and Scripting

Inserting IDs from a text file into a sequence alignment file

Hi, I have one file with one column and several hundred entries File1: NA1 NA2 NA3And now I need to run a command within a mapping aligner tool to insert these sample names into a sequence alignment file (SAM) such that they look like this @RG ID:Library1 SM:NA1 PL:Illumina ... (7 Replies)
Discussion started by: nans
7 Replies

6. Shell Programming and Scripting

Match text from file 1 to file 2 and return specific text

I hope this makes sense and is possible. I am trying to match $1 of panel_genes.txt with $3 of RefSeqGene.txt and when a match is found the value in $6 of RefSeqGene.txt Example: ACTA2 is $1 of panel_genes.txt ACTA2 NM_001613.2 ACTA2 NM_001141945.1 awk 'FNR==NR {... (4 Replies)
Discussion started by: cmccabe
4 Replies

7. Shell Programming and Scripting

Display match or no match and write a text file to a directory

The below bash connects to a site, downloads a file, searches that file based of user input - could be multiple (all that seems to work). What I am not able to figure out is how to display on the screen match found or no match found" and write a file to a directory (C:\Users\cmccabe\Desktop\wget)... (4 Replies)
Discussion started by: cmccabe
4 Replies

8. Shell Programming and Scripting

Match all lines in file where specific text pattern is less than

In the below file I am trying to grep or similar, all lines where only AF= is less than 0.4.. Thank you :). grep grep "AF=" ,+ .4 file file 12 112036782 . T C 34.0248 PASS ... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

Insert text after match in XML file

Having a little trouble getting this to work just right. I have xml files that i want to split some data. I have 2 <name> tags within the file I would like to take only the first tag and split the data. tag example. From this. TAB<Name>smith, john</Name> to TAB<Name>smith,... (8 Replies)
Discussion started by: whegra
8 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
zzat(1) 						      General Commands Manual							   zzat(1)

NAME
zzat - concatenate files using different instruction sequences SYNOPSIS
zzat [-AbdeEntTv] [-r loops] [-x sequence] [FILE]... zzat -l | --list zzat -h | --help zzat -V | --version DESCRIPTION
The zzat utility reads files sequentially, writing them to the standard output. The user can decide which sequence of library calls is used to seek and read data. zzat is primarily used as a debugging tool for zzuf, because it can emulate different programs' ways to read files. OPTIONS
-A, --show-all Equivalent to -vET. -b, --number-nonblank Number nonempty output lines. -d, --debug Output debugging information. -e Equivalent to -vET. -E, --show-ends Display $ at end of each line. -n, --number Number all output lines. -r, --repeat=loops Concatenate all files loops times. -t Equivalent to -vT. -T, --show-tabs Display TAB characters as ^I. -v, --show-nonprinting Use ^ and M- notation, except for LFD and TAB. -x, --execute=sequence Read a file or a stream using the instruction sequence specified in sequence. Instructions are executed sequentially until the end of the program. End-of-file is not an exit condition, except where the feof keyword is used: fread(1,10); feof(1); fread(1,10) Loops are permitted using the repeat keyword. Again, feof can be used to prematurely break out of a loop: repeat(10000, fgetc() feof(1)) Instructions can be separated by spaces, commas or semicolons. A list of all available instructions and control keywords can be obtained using this command: zzat -l If no sequence is specified, the following default sequence is used: repeat(-1, fread(1,32768), feof(1)) -l, --list Display the list of supported keywords and functions and exit. -h, --help Display a short help message and exit. -V, --version Output version information and exit. EXAMPLES
Read the first 1000 bytes of f, then exit: zzat -x 'fread(1,1000)' f Read the first four bytes of f, using four different instructions: zzat -x 'getc(),fgetc(),getc_unlocked(),_IO_getc()' f Read f entirely, by calling getc() repeatedly until end-of-file is reached: zzat -x 'repeat(-1, getc(), feof(1))' f Read f entirely, in chunks of 32768 bytes until end-of-file is reached: zzat -x 'repeat(-1, fread(1,32768), feof(1))' f SEE ALSO
zzuf(3), libzzuf(3) AUTHOR
Copyright (C) 2002-2010 Sam Hocevar <sam@hocevar.net>. zzat and this manual page are free software. They come without any warranty, to the extent permitted by applicable law. You can redis- tribute them and/or modify them under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. zzuf's webpage can be found at http://caca.zoy.org/wiki/zzuf. An overview of the architecture and inner works is at http://caca.zoy.org/wiki/zzuf/internals. zzat 0.13 2010-01-07 zzat(1)
All times are GMT -4. The time now is 04:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy