Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to cut prefix from a string Post 302286799 by kaixinsjtu on Thursday 12th of February 2009 01:39:02 AM
Old 02-12-2009
Error how to cut prefix from a string

I have a file:

chromosome1:436728
chromosome2:32892
.....
chromosome22:23781

I just want to get the number, not the prefix "chromosomeX", so I want to remove all the prefix ahead of the numbers. How can I do that?? Thanks!!! (PS: give me some very simple command so that I can understand it... Smilie )

Last edited by kaixinsjtu; 02-12-2009 at 02:47 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to cut prefix from a string?

Hi folks, I have the following parameter setting: export ADMIN_HOST_NAME=http://hostname.com I want to define a new parameter,ADMIN_HOST_NAME_NEW,which based on $ADMIN_HOST_NAME but I need to remove the prefix "http://". The requested result for $ADMIN_HOST_NAME_NEW is hostname.com How... (2 Replies)
Discussion started by: nir_s
2 Replies

2. Shell Programming and Scripting

read string, check string length and cut

Hello All, Plz help me with: I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Discussion started by: ozzy80
9 Replies

3. Shell Programming and Scripting

Prefix a string to the contents of a file

Hi all, I have a requirement where in i have to create a temporary file by prefixing a string of special characters to each row of a input file. the input file is '|' delimited. here is the content of input file aaa|1234|axad|123 bbb|qwqw|qw|1334 the output should be ... (5 Replies)
Discussion started by: nvuradi
5 Replies

4. Shell Programming and Scripting

QUERY_STRING with multiples appearances of the same string prefix

I have a shell script and it works pretty well to pull out the query_string contents of a single instance of router= But if I have multiple router= strings, it only pulls out the last one. Is there a way to pull out every router= and if there is a multple string, to egrep them together... (1 Reply)
Discussion started by: numele
1 Replies

5. Shell Programming and Scripting

Replace prefix and suffix of a string

Hi, I'm new about shell scripting, and I need to do something like abcd **1234** efgh by abcd '''1234''' efgh I know that command sed helps about change one string by another, but I dont know how to keep whatever is inside **_** and replace * with '. Thanks! (5 Replies)
Discussion started by: selvaya
5 Replies

6. Shell Programming and Scripting

Using filename to determine a prefix that needs to be added to string column on file?

Possible filenames: CDD_Whatever.txt DDD_Whatever.txt If the file prefix = CDD, I'd like to prefix every person ID (second column in my examples below) on the file with "c-" If the file prefix = DDD, I'd like to prefix ever person ID with "d-" Input: Desired Output: Any help... (2 Replies)
Discussion started by: lrluis
2 Replies

7. Shell Programming and Scripting

Cut the string

Hi in a directory i've files having the following name for_category_info_19990101984301 for_catgry_meta_19991111214601 ------- I just want the name till year and month i.e; for_category_info_199901 for_catgry_meta_199911 How can i achieve the above string Thanks (2 Replies)
Discussion started by: smile689
2 Replies

8. Shell Programming and Scripting

Cut the string

---------- Post updated at 10:31 AM ---------- Previous update was at 10:28 AM ---------- Hello, I am trying to get the string cut based on the following needs: String1=Submitted request 25574824 for CONCURRENT SQLAP RUAPACTUALSEXT Y RUAPACTUALS122313100616.dat "2013/01/12 14:50:44"... (6 Replies)
Discussion started by: cartrider
6 Replies

9. Shell Programming and Scripting

Removing only Prefix string (!)

Hello everyone, I want to remove only prefix ME_ from all the values that are present in the FILEA. Below code I'm using for this. sed 's/ME\_//g' FILEA > FILEB Using the above code, all ME_ values are getting removed from the file. But the problem here is I want to remove only Prefix ME_... (4 Replies)
Discussion started by: ed_9
4 Replies

10. Shell Programming and Scripting

Extract Uniq prefix from a start and end prefix

Dear All, assume i have a file with content: <Start>6000</Start> <Stop>7599</Stop> the output is: 6000 7000 7100 7200 7300 7400 7599 how should we use any awk, sed, perl can do this task, means to extract the uniq prefixes from the start and stop prefix. Thanks Jimmy (3 Replies)
Discussion started by: jimmy_y
3 Replies
BISON(1)                                                      General Commands Manual                                                     BISON(1)

NAME
bison - GNU Project parser generator (yacc replacement) SYNOPSIS
bison [ -b file-prefix ] [ --file-prefix=file-prefix ] [ -d ] [ --defines ] [ -l ] [ --no-lines ] [ -o outfile ] [ --output-file=outfile ] [ -p prefix ] [ --name-prefix=prefix ] [ -t ] [ --debug ] [ -v ] [ --verbose ] [ -V ] [ --version ] [ -y ] [ --yacc ] [ --fixed-output- files ] file DESCRIPTION
Bison is a parser generator in the style of yacc(1). It should be upwardly compatible with input files designed for yacc. Input files should follow the yacc convention of ending in .y. Unlike yacc, the generated files do not have fixed names, but instead use the prefix of the input file. For instance, a grammar description file named parse.y would produce the generated parser in a file named parse.tab.c, instead of yacc's y.tab.c. This description of the options that can be given to bison is adapted from the node Invocation in the bison.texinfo manual, which should be taken as authoritative. Bison supports both traditional single-letter options and mnemonic long option names. Long option names are indicated with -- instead of -. Abbreviations for option names are allowed as long as they are unique. When a long option takes an argument, like --file-prefix, con- nect the option name and the argument with =. OPTIONS -b file-prefix --file-prefix=file-prefix Specify a prefix to use for all bison output file names. The names are chosen as if the input file were named file-prefix.c. -d --defines Write an extra output file containing macro definitions for the token type names defined in the grammar and the semantic value type YYSTYPE, as well as a few extern variable declarations. If the parser output file is named name.c then this file is named name.h. This output file is essential if you wish to put the definition of yylex in a separate source file, because yylex needs to be able to refer to token type codes and the variable yylval. -l --no-lines Don't put any #line preprocessor commands in the parser file. Ordinarily bison puts them in the parser file so that the C compiler and debuggers will associate errors with your source file, the grammar file. This option causes them to associate errors with the parser file, treating it an independent source file in its own right. -o outfile --output-file=outfile Specify the name outfile for the parser file. The other output files' names are constructed from outfile as described under the -v and -d switches. -p prefix --name-prefix=prefix Rename the external symbols used in the parser so that they start with prefix instead of yy. The precise list of symbols renamed is yyparse, yylex, yyerror, yylval, yychar, and yydebug. For example, if you use -p c, the names become cparse, clex, and so on. -t --debug Output a definition of the macro YYDEBUG into the parser file, so that the debugging facilities are compiled. -v --verbose Write an extra output file containing verbose descriptions of the parser states and what is done for each type of look-ahead token in that state. This file also describes all the conflicts, both those resolved by operator precedence and the unresolved ones. The file's name is made by removing .tab.c or .c from the parser output file name, and adding .output instead. Therefore, if the input file is foo.y, then the parser file is called foo.tab.c by default. As a consequence, the verbose output file is called foo.output. -V --version Print the version number of bison. -y --yacc --fixed-output-files Equivalent to -o y.tab.c; the parser output file is called y.tab.c, and the other outputs are called y.output and y.tab.h. The pur- pose of this switch is to imitate yacc's output file name conventions. Thus, the following shell script can substitute for yacc: bison -y $* The long-named options can be introduced with `+' as well as `--', for compatibility with previous releases. Eventually support for `+' will be removed, because it is incompatible with the POSIX.2 standard. FILES
/usr/local/lib/bison.simple simple parser /usr/local/lib/bison.hairy complicated parser SEE ALSO
yacc(1) The Bison Reference Manual, included as the file bison.texinfo in the bison source distribution. DIAGNOSTICS
Self explanatory. local BISON(1)
All times are GMT -4. The time now is 08:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy