if statement - Bash- Parse a word if a symbol exists -


I am trying to parse a file in a specific string. I have to get the area from one part of a file, but this variable can be. Here is the file format:

  info INFO2 info3 number: number-NUM_1 | SFSDFDSFAWEAB-SDSSDF | SDFSD207; DSFDS140 INFO2 info3 number: number-number | SFSDFDCDVD-SDDFSDFF | SDFSD207; DSFDS140 INFO2 info3 number: number-NUM_2 | SFSDDSFD-ERSWSDFSDF | SDFSD207; DSFDS140  

I am trying to get the number: number-NUM_1 to be just number: number-number but Every entry "_ #" has been successful so much:

  # / bin / bash, while doing the reading line, titletmp = $ (echo $ line | deduction -d '\ t' -f4 ) Roy = $ (echo $ titletmp | -d deduction '|' '-f1) done  

Which gets me as far as: number: num-num_1 But I can not understand how to do any of the next bit Jav?

To remove the symbol below and use the suffix, delete: For example:

  $ roy = number: numeric value = $ roy = $ {roy% _ *}  

NUM_1 $ roy = $ {roi% _ *} $ echo $ roi num: num-num


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -