Sponsored Content
Top Forums Shell Programming and Scripting How to extract a paragraph containing a given string? Post 302976740 by pravin27 on Tuesday 5th of July 2016 08:19:04 AM
Old 07-05-2016
Delphys,
Perl one liner works at my end. It would be helpful if you could attached part of your i/p file.
~Pravin~
 

10 More Discussions You Might Find Interesting

1. Linux

Extract a paragraph

Hi , Unix.com has been life saver for me I admit :) I am trying to extract a paragraph based on matching pattern "CREATE TABLE " from a ddl file . The paragraphs are seperated by blank line . Input file is #cat zip.20080604.sql1 CONNECT TO TST103 SET SESSION_USER OPSDM002 ... (2 Replies)
Discussion started by: capri_drm
2 Replies

2. Shell Programming and Scripting

Search for string in a file and extract another string to a variable

Hi, guys. I have one question: I need to search for a string in a file, and then extract another string from the file and assign it to a variable. For example: the contents of the file (group) is below: ... ftp:x:23: mail:x:34 ... testing:x:2001 sales:x:2002 development:x:2003 ...... (6 Replies)
Discussion started by: daikeyang
6 Replies

3. Shell Programming and Scripting

Search for a particular string in a paragraph in a text

Hi all, i'm new to this community. I am trying to write a script which will fetch ftp completion time of a file from a paragraph of a big text file ( which contains multiple paragraphs) . Each paragraph will have ftp details.. Now I dont know how to fetch process time within a paragraph of... (3 Replies)
Discussion started by: prachiagra
3 Replies

4. UNIX for Dummies Questions & Answers

Output text from 1st paragraph in file w/ a specific string through last paragraph of file w/ string

Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string. Previously, I was outputting just each paragraph with that search string with: cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
Discussion started by: carpenn
2 Replies

5. Shell Programming and Scripting

How to extract multiple line in a paragraph? Please help.

Hi all, The following lines are taken from a long paragraph: Labels of output orbitals: RY* RY* RY* RY* RY* RY* 1\1\GINC-COMPUTE-1-3\SP\UB3LYP\6-31G\C2H5Cr1O1(1+,5)\LIUZHEN\19-Jan-20 10\0\\# ub3lyp/6-31G pop=(nbo,savenbo) gfprint\\E101GECP\\1,5\O,0,-1.7 ... (1 Reply)
Discussion started by: liuzhencc
1 Replies

6. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

7. Shell Programming and Scripting

Search String and extract few lines under the searched string

Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed Bold letters are the stations . The whole file has multiple stations . Below example i wanted to search... (4 Replies)
Discussion started by: ajayram_arya
4 Replies

8. Shell Programming and Scripting

How to extract every repeated string between two specific string?

Hello guys, I have problem with hpux shell script. I have one big text file that contains like SOH bla bla bla bla bla bla ETX SOH bla bla bla ETX SOH bla bla bla ETX What I need to do is save first SOH*BLA into file1.txt, save second SOH*BLA into file2.txt and so on.... (17 Replies)
Discussion started by: sembii
17 Replies

9. UNIX for Dummies Questions & Answers

Extract paragraph that contains a value x<-30

I am using OSX. I have a multi-mol2 file (text file with coordinates and info for several molecules). An example of two molecules in the file is given below for molecule1 and molecule 2. The total file contains >50,000 molecules. I would like to extract out and write to another file only the... (2 Replies)
Discussion started by: Egy
2 Replies

10. Shell Programming and Scripting

Bash script to extract paragraph with globs in it

Hi, Its been a long time since I have used Bash to write a script so am really struggling here. Need the gurus to help me out. uname -a Linux lxserv01 2.6.18-417.el5 i have a text file with blocks of code written in a similar manner ******* BEGIN MESSAGE ******* Station /... (12 Replies)
Discussion started by: dsid
12 Replies
PERLCC(1)						 Perl Programmers Reference Guide						 PERLCC(1)

NAME
perlcc - generate executables from Perl programs SYNOPSIS
$ perlcc hello # Compiles into executable 'a.out' $ perlcc -o hello hello.pl # Compiles into executable 'hello' $ perlcc -O file # Compiles using the optimised C backend $ perlcc -B file # Compiles using the bytecode backend $ perlcc -c file # Creates a C file, 'file.c' $ perlcc -S -o hello file # Creates a C file, 'file.c', # then compiles it to executable 'hello' $ perlcc -c out.c file # Creates a C file, 'out.c' from 'file' $ perlcc -e 'print q//' # Compiles a one-liner into 'a.out' $ perlcc -c -e 'print q//' # Creates a C file 'a.out.c' $ perlcc -I /foo hello # extra headers (notice the space after -I) $ perlcc -L /foo hello # extra libraries (notice the space after -L) $ perlcc -r hello # compiles 'hello' into 'a.out', runs 'a.out'. $ perlcc -r hello a b c # compiles 'hello' into 'a.out', runs 'a.out'. # with arguments 'a b c' $ perlcc hello -log c # compiles 'hello' into 'a.out' logs compile # log into 'c'. DESCRIPTION
perlcc creates standalone executables from Perl programs, using the code generators provided by the B module. At present, you may either create executable Perl bytecode, using the "-B" option, or generate and compile C files using the standard and 'optimised' C backends. The code generated in this way is not guaranteed to work. The whole codegen suite ("perlcc" included) should be considered very experimen- tal. Use for production purposes is strongly discouraged. OPTIONS
-Llibrary directories Adds the given directories to the library search path when C code is passed to your C compiler. -Iinclude directories Adds the given directories to the include file search path when C code is passed to your C compiler; when using the Perl bytecode option, adds the given directories to Perl's include path. -o output file name Specifies the file name for the final compiled executable. -c C file name Create C code only; do not compile to a standalone binary. -e perl code Compile a one-liner, much the same as "perl -e '...'" -S Do not delete generated C code after compilation. -B Use the Perl bytecode code generator. -O Use the 'optimised' C code generator. This is more experimental than everything else put together, and the code created is not guaran- teed to compile in finite time and memory, or indeed, at all. -v Increase verbosity of output; can be repeated for more verbose output. -r Run the resulting compiled script after compiling it. -log Log the output of compiling to a file rather than to stdout. perl v5.8.9 2009-06-25 PERLCC(1)
All times are GMT -4. The time now is 12:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy