Sponsored Content
Top Forums Shell Programming and Scripting Getting 15 characters after search phrase Post 302332150 by bfr on Wednesday 8th of July 2009 08:36:59 AM
Old 07-08-2009
Getting 15 characters after search phrase

I have data that looks like this:

Code:
2002  140  40800.0060  GPS 20  C1  25477810.2305
2002  140  41100.0060  GPS 20  C1  25298056.0453

I need to get data after certain pattern.. for example if i search for C1
it should return

Code:
25477810.2305
25298056.0453

To achieve this, it should:

1) In the best scenario, if possible, it would start after the space/spaces that come after the search word, print the characters, and stop when space is found again

2) if that is not possible, other way would be to return 15 characters after the search pattern(after = the pattern itself would be excluded).

I tried with grep and sed, but could not get the results i wanted..

Thank you in advance!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Best way to search files for non-printable characters?

I need to check ftp'd incoming files for characters that are not alphanumeric,<tab>, <cr>, or <lf> characters. Each file would have 10-20,000 line with up to 3,000 characters per line. Should I use awk, sed, or grep and what would the command look like to do such a search? Thanks much to anyone... (2 Replies)
Discussion started by: jvander
2 Replies

2. UNIX for Dummies Questions & Answers

search special characters in a file

Hello I am new to shell scripting and can anyone tell me how to check if there are any special characters in a file. Can i use grep ? thanks susie (2 Replies)
Discussion started by: cramya80
2 Replies

3. Shell Programming and Scripting

Search For Control M characters in files

Hi , I have special character control M in many of my files as below ersNet-Telnet-3.03/Makefile.PL100644 21166 144 612 7113770214 135 77 0ustar jayusers## -*- Perl -*-^M ^M use ExtUtils::MakeMaker qw(WriteMakefile);^M ^M WriteMakefile(NAME => "Net::Telnet",^M ... (4 Replies)
Discussion started by: Mohammed
4 Replies

4. Shell Programming and Scripting

search and replace characters in one string

I have lines like: Dog Cat House Mouse Dog Cat House Mouse Dog Cat House Mouse Dog Cat House Mouse I'd like to replace characters only in $3. H -> Z s -> W e -> x Resulting in something like (where $1, $2, and $4 are not changed): Dog Cat ZouWx Mouse Dog Cat ZouWx Mouse... (3 Replies)
Discussion started by: dcfargo
3 Replies

5. Shell Programming and Scripting

Search a String for characters - or +

How would I accomplish this if I want to test to see if it 1) starts with a dash so something like "-R" AND 2) starts with 1 character then either a "-" or "+" and then up to 3 characters such as "a+rx" (3 Replies)
Discussion started by: mkjp2011
3 Replies

6. Shell Programming and Scripting

search for a set of characters and move

I want to search/grep for a set of characters in a file(all occurences) and move them to another file. Any command line? regards, Sri (2 Replies)
Discussion started by: Sriranga
2 Replies

7. Shell Programming and Scripting

Code to search for a phrase and run a command

hi All, Am newbie to unix and would require your help to complete this task. Condition: I have a server start up script and I would like to append the code in such a way that it searches for a phrase "process completed" in taillog when server starts up and also should run another script... (9 Replies)
Discussion started by: fop4658
9 Replies

8. UNIX for Dummies Questions & Answers

[Solved] How to search for these escape characters?

echo "***Enter new LISTENER_PORT (only applicable to new instance), " I used the following: E486: Pattern not found: echo \"\*\*\*Enter new LISTENER_PORT \(only applicable to new instanace\), \" when I try to search for the above line, I'm not able to do it so how do I search for the... (5 Replies)
Discussion started by: jediwannabe
5 Replies

9. Shell Programming and Scripting

How to find a phrase and pull all lines that follow until the phrase occurs again?

I want to burst a report by using the page number value in the report header. Each section starts with *PAGE NO:* 1 Each section might have several pages, but the next section always starts back at 1. So I want to find the "*PAGE NO:* 1" value and pull all lines that follow until "*PAGE NO:* 1"... (4 Replies)
Discussion started by: Scottie1954
4 Replies

10. Shell Programming and Scripting

Search avoiding special characters

Hi all, I have a list which I want to search in another file. I can do that using grep -f but the search is failing due to special characters, how do I solve this? One row in that list is amino-acid permease inda1 gb|EDU41782.1| amino-acid permease inda1 Input file to be searched... (2 Replies)
Discussion started by: gina.lizar
2 Replies
RNGTEST(1)						      General Commands Manual							RNGTEST(1)

NAME
rngtest - Check the randomness of data using FIPS 140-2 tests SYNOPSIS
rngtest [-c n | --blockcount=n] [-b n | --blockstats=n] [-t n | --timedstats=n] [-p | --pipe] [-?] [--help] [-V] [--version] DESCRIPTION
rngtest works on blocks of 20000 bits at a time, using the FIPS 140-2 (errata of 2001-10-10) tests to verify the randomness of the block of data. It takes input from stdin, and outputs statistics to stderr, optionally echoing blocks that passed the FIPS tests to stdout (when operating in pipe mode). Errors are sent to stderr. At startup, rngtest will throw away the first 32 bits of data when operating in pipe mode. It will use the next 32 bits of data to boot- strap the FIPS tests (even when not operating in pipe mode). These bits are not tested for randomness. Statistics are dumped to stderr when the program exits. OPTIONS
-p, --pipe Enable pipe mode. All data blocks that pass the FIPS tests are echoed to stdout, and rngtest operates in silent mode. -c n, --blockcount=n (default: 0) Exit after processing n input blocks, if n is not zero. -b n, --blockstats=n (default: 0) Dump statistics every n blocks, if n is not zero. -t n, --timedstats=n (default: 0) Dump statistics every n secods, if n is not zero. -?, --help Give a short summary of all program options. -V, --version Print program version STATISTICS
rngtest will dump statistics to stderr when it exits, and when told to by blockstats or timedstats. FIPS 140-2 successes and FIPS 140-2 failures counts the number of 20000-bit blocks either accepted or rejected by the FIPS 140-2 tests. The other statistics show a breakdown of the FIPS 140-2 failures by FIPS 140-2 test. See the FIPS 140-2 document for more information (note that these tests are defined on FIPS 140-1 and FIPS 140-2 errata of 2001-10-10. They were removed in FIPS 140-2 errata of 2002-12-03). The speed statistics are taken for every 20000-bit block trasferred or processed. EXIT STATUS
0 if no errors happen, and no blocks fail the FIPS tests. 1 if no errors happen, but at least one block fails the FIPS tests. 10 if there are problems with the parameters. 11 if an input/output error happens. 12 if an operating system or resource starvation error happens. SEE ALSO
random(4), rngd(8) FIPS PUB 140-2 Security Requirements for Cryptographic Modules, NIST, http://csrc.nist.gov/cryptval/140-2.htm AUTHORS
Henrique de Moraes Holschuh <hmh@debian.org> rng-tools 2-unofficial-mt.14 March 2004 RNGTEST(1)
All times are GMT -4. The time now is 09:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy