Sponsored Content
Top Forums Shell Programming and Scripting awk, sed or perl regexp to print values from file Post 302625257 by cabrao on Tuesday 17th of April 2012 12:47:23 PM
Old 04-17-2012
This is great Scrutinizer, thank you again for your precious help!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using awk or sed to print output from one file

dear i have one file regarding >abshabja>sdksjbs>sknakna>snajxcls so i want to be output like >abshabja >sjkabjb >sknakna >snajxcls Any using awk or sed will help thanks (2 Replies)
Discussion started by: cdfd123
2 Replies

2. UNIX for Dummies Questions & Answers

print the line immediately after a regexp; but regexp is a sentence

Good Day, Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp. sed -n '/regexp/{n;p;}' filename What if my regexp is 3 word or a sentence. Im... (3 Replies)
Discussion started by: ownins
3 Replies

3. Shell Programming and Scripting

...yet another string of awk/sed questions from a RegExp-Challenged luser %-\

Greetings all, ...here is yet another string of awk/sed questions from a RegExp-Challenged luser :eek: I'm looking to have sed/awk do some clean-up on routing tables and to that end, I would like to do the following: 1.) If a line contains the word "masks" or "subnets" prepend CR/LF to... (16 Replies)
Discussion started by: SteveB-in-LV
16 Replies

4. Shell Programming and Scripting

Print required values at end of the file by using AWK

I am looking help in awk, quick overview. we will get feed from external system . The input file looks like below. Detail Id Info Id Order Id STATUS Status Date FileDetail 99127942 819718 CMOG223481502 PR 04-17-2011 06:01:34PM... (7 Replies)
Discussion started by: dvrbabu
7 Replies

5. Shell Programming and Scripting

replace awk with a perl one liner (REGEXP and FS)

hello, I want to replace awk with a perl one liner in unix. i use in awk REGEX and FS ( field separator) because awk syntaxes in different unix os versions have not the same behaviour. Awk, Nawk and GNU Awk Cheat Sheet - good coders code, great reuse i have a file named "file" and want... (5 Replies)
Discussion started by: bora99
5 Replies

6. UNIX for Advanced & Expert Users

Awk to print values of second file

Hello, I have a data file with 300,000 records in it, and another file which contains only the line numbers of roughly 13,000 records in the data file which have data integrity issues. I'm trying to find a way to print the original data by line number identified in the second file. How can I do... (2 Replies)
Discussion started by: peteroc
2 Replies

7. Shell Programming and Scripting

sed print first line before regexp and all lines after

Hi All I'm trying to extract the line just above a regexp and all lines after this. I'm currently doing this in two steps sed -n -e "/^+---/{g;p;}" -e h oldfile.txt > modified.txt sed -e "1,/^+---/d" -e "/^$/d" oldfile.txt >>modified.txt Sample sometext will be here sometext will be... (3 Replies)
Discussion started by: Celvin VK
3 Replies

8. Shell Programming and Scripting

awk regexp to print repetitive pattern

How to use regexp to print out repetitive pattern in awk? $ awk '{print $0, "-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-"}' output: - - - - - - - - - - - -I tried following which does not give what I want, of course. awk '{print $0, "-\t{11}-"}' output: - ... (10 Replies)
Discussion started by: yifangt
10 Replies

9. Shell Programming and Scripting

awk to print line is values between two fields in separate file

I am trying to use awk to find all the $3 values in file2 that are between $2 and $3 in file1. If a value in $3 of file2 is between the file1 fields then it is printed along with the $6 value in file1. Both file1 and file2 are tab-delimited as well as the desired output. If there is nothing to... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. UNIX for Beginners Questions & Answers

awk or sed to print the character from the previous line after the regexp match

Hi All, I need to print the characters in the previous line just before the regular expression match Please have a look at the input file as attached I need to match the regular expression ^ with the character of the previous like and also the pin numbers and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
CMIGREP(1)						      General Commands Manual							CMIGREP(1)

NAME
cmigrep - search in ocaml compiled interface files SYNOPSIS
cmigrep <options> <module-expression> DESCRIPTION
This manual page documents briefly the cmigrep command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. cmigrep allows to search for information in compiled interfaces of OCaml modules. By default, the search applies to the modules described in the .cmi files in the curent directory and in the ocaml standard directory, but this can be changed with the -I option (see below). The argument <module-expr> can be an exact module name, or a shell wildcard. Multiple modules can be specified. Example: "ModA ModB Foo*.Make" means to search ModA, ModB, and any submodule Make of a module that starts with Foo. OPTIONS
General Options -I directory Add directory to the search path for modules -package packages comma separated list of findlib packages to search open modules comma separated list of open modules (in order!) -help, --help display list of options Search Patterns -t regexp print types with matching names -r regexp print record field labels with matching names -c regexp print constructors with matching names -p regexp print polymorphic variants with matching names -m regexp print all matching module names in the path -e regexp print exceptions with matching constructors -v regexp print values with matching names -o regexp print all classes with matching names -a regexp print all names which match the given expression SEE ALSO
Examples can be found on /usr/share/doc/cmigrep/README. AUTHOR
cmigrep is written by Eric Stokes <letaris@mac.com>. This manual page was compiled by Ralf Treinen <treinen@debian.org>. CMIGREP(1)
All times are GMT -4. The time now is 04:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy