01-31-2013
Quote:
Originally Posted by
andreia
Thanks for the answers ...
yes, the minus sign (on sequence) needs to include on search like if was an similar letter A-Z ... its a fasta sequence aligned so its normal when protein/nucleotide sequence gets minus sign ...
I'm sorry, but biology was not my major. Please explain how a program reading your input file is supposed to know which minus signs should be removed when merging input lines. (None of the provided scripts produce the output you said you wanted because the output you said you want to get drops five out of six minus signs in the second line of each output pair.)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all:
I have a file in which the contents are as following:
...
This is a test
ONE
TWO
Hello, world!
XXX YYY CCC
test again
three, four
five
six
seven
world
AAA BBB QQQ
test
eight, nine
world (3 Replies)
Discussion started by: xb88
3 Replies
2. Shell Programming and Scripting
Hi,
I have a tab delimited flat file like this: 189 Guide de lutilisateur sur lappel conférence à trois au moyen d'adaptateurs téléphoniques <TABLE><TBODY><TR><TD><DIV class=subheader>La fonction Appel conférence à trois </DIV></TD>
\
<TD><?php print $navTree;?> vous permet de tenir un appel... (4 Replies)
Discussion started by: hnhegde
4 Replies
3. Shell Programming and Scripting
I'm sure this will be an easy question for you experts out there, but I have been searching the forum and working on this for a couple hours now and can't get it right.
I have a very messy data file that I am trying to tidy up - one of the issues is some records are split into multiple lines: ... (4 Replies)
Discussion started by: tink
4 Replies
4. Shell Programming and Scripting
Hi,
Can anyone help me for merge the following multi-line logs( the black lines) which beginning with time: into one line. For the line with "-", it needs to be deleted. Please see the red color line.
#########################################
time: 20080817073334
dn: uid=ok,ou=nbt... (3 Replies)
Discussion started by: missyou
3 Replies
5. Shell Programming and Scripting
I've hunted and hunted but nothing seems to apply to what I need. Any help will be much appreciated!
My input file looks like (Unix):
marker,allele1,allele2
RS1002244,1,1
RS1002244,1,3
RS1002244,3,3
RS1003719,2,2
RS1003719,2,4
RS1003719,4,4
Most markers are listed 3 times but a few... (2 Replies)
Discussion started by: Peggy White
2 Replies
6. UNIX for Dummies Questions & Answers
Hi Experts,
This is my input file.
input.txt
0 /dev/fd
25 /var
1 /tmp
1 /var/run
1. If this file has single line, then leave it, print the single line
else
merge the 4 lines above into 1 line as below
e.g (6 Replies)
Discussion started by: streddy
6 Replies
7. Shell Programming and Scripting
I've been a Unix admin for nearly 30 years and never learned AWK. I've seen several similar posts here, but haven't been able to adapt the answers to my situation. AWK is so damn cryptic! ;)
I have a single file with ~900 lines (CSV list). Each line starts with an ID, but with different stuff... (6 Replies)
Discussion started by: protosd
6 Replies
8. Shell Programming and Scripting
example:
comment Now_TB.table column errac is for error messages
1 - first
2 - second
3 -third ;
in this example I need to be able to grab the comment as first word and ; as the last word and it might span a few lines. I need it to be put all in one line without line breaks so I can... (4 Replies)
Discussion started by: wambli
4 Replies
9. UNIX for Dummies Questions & Answers
I want to merge every 16 lines into one line, how can I do that? My file looks like below:
0
.
2
2
.
0
0
.
0
0
.
0
0
.
0
0
0
0
0 (2 Replies)
Discussion started by: ml4me
2 Replies
10. Shell Programming and Scripting
Hi all, I'm relatively new to scripting, I can do pretty basic things. I have a daily log file that looks like:
timestamp=2017-06-28-01.01.35.080576;
event status=0;
userid=user1;
authid=user1;
application id=10.10.10.10.11111.12345678901;
application name=GUI;
... (29 Replies)
Discussion started by: dwdnet
29 Replies
LEARN ABOUT OPENSOLARIS
ddi_strtol
ddi_strtol(9F) Kernel Functions for Drivers ddi_strtol(9F)
NAME
ddi_strtol - String conversion routines
SYNOPSIS
#include <sys/ddi.h>
#include <sys/sunddi.h>
int ddi_strtol(const char *str, char **endptr, int base,
long *result);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI)
PARAMETERS
str Pointer to a character string to be converted.
endptr Post-conversion final string of unrecognized characters.
base Radix used for conversion.
result Pointer to variable which contains the converted value.
DESCRIPTION
The ddi_strtol() function converts the initial portion of the string pointed to by str to a type long int representation and stores the
converted value in result.
The function first decomposes the input string into three parts:
1. An initial (possibly empty) sequence of white-space characters (' ', ' ', '
', '
', 'f')
2. A subject sequence interpreted as an integer represented in some radix determined by the value of base
3. A final string of one or more unrecognized characters, including the terminating null byte of the input string.
The ddi_strtol() function then attempts to convert the subject sequence to an integer and returns the result.
If the value of base is 0, the expected form of the subject sequence is a decimal constant, octal constant or hexadecimal constant, any of
which may be preceded by a plus ("+") or minus ("-") sign. A decimal constant begins with a non-zero digit, and consists of a sequence of
decimal digits. An octal constant consists of the prefix 0 optionally followed by a sequence of the digits 0 to 7 only. A hexadecimal
constant consists of the prefix 0x or 0X followed by a sequence of the decimal digits and letters a (or A) to f (or F) with values 10 to
15 respectively.
If the value of base is between 2 and 36, the expected form of the subject sequence is a sequence of letters and digits representing an
integer with the radix specified by base, optionally preceded by a plus or minus sign. The letters from a (or A) to z (or Z) inclusive are
ascribed the values 10 to 35 and only letters whose ascribed values are less than that of base are permitted. If the value of base is 16,
the characters 0x or 0X may optionally precede the sequence of letters and digits following the sign, if present.
The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character
that is of the expected form. The subject sequence contains no characters if the input string is empty or consists entirely of white-space
characters or if the first non-white-space character is other than a sign or a permissible letter or digit.
If the subject sequence has the expected form and the value of base is 0, the sequence of characters starting with the first digit is
interpreted as an integer constant. If the subject sequence has the expected form and the value of base is between 2 and 36, it is used as
the base for conversion, ascribing to each letter its value as given above. If the subject sequence begins with a minus sign, the value
resulting from the conversion is negated. A pointer to the final string is stored in the object pointed to by endptr, provided that endptr
is not a null pointer.
If the subject sequence is empty or does not have the expected form, no conversion is performed and the value of str is stored in the
object pointed to by endptr, provided that endptr is not a null pointer.
RETURN VALUES
Upon successful completion, ddi_strtol() returns 0 and stores the converted value in result. If no conversion is performed due to invalid
base, ddi_strtol() returns EINVAL and the variable pointed by result is not changed.
If the correct value is outside the range of representable values, ddi_strtol() returns ERANGE and the value pointed to by result is not
changed.
CONTEXT
The ddi_strtol() function may be called from user, kernel or interrupt context.
SEE ALSO
Writing Device Drivers
SunOS 5.11 13 May 2004 ddi_strtol(9F)