Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Output text from 1st paragraph in file w/ a specific string through last paragraph of file w/ string Post 302411874 by carpenn on Friday 9th of April 2010 04:02:30 PM
Old 04-09-2010
Tools 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:

Code:
cat in_file | nawk '{RS=""; FS="\n"; ORS="\n\n"; OFS="\n"} /searchstring/ {print}' > out_file

The problem I've ran into is that that search string does not always appear in some paragraphs that are logged between the 1st and last occurrences.

Any ideas to make this happen?

Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

selecting each paragraph and put it into a file...help me

Dear Friends, I need a shell script. I am facing a problem while selecting the text that is between start and end tags. and insert the paragraph into a file1, next paragraph in file2...... experts please help. i have a file which contains, -------------- <abc> 111some text some text some... (2 Replies)
Discussion started by: swamymns
2 Replies

2. Shell Programming and Scripting

Replacing a paragraph between pattern , with the content 4m another file

hi, i wanted to put the output of file f1 into the pattern space of file f2 f1: wjwjwjwjwjwjwj //these line go in file f2 jwjwjwjwjwjjwjw wjwjwjwjjwjwjwj f2: Pattern_start __________ //these are the line to be replaced __________ Pattern_end i m... (4 Replies)
Discussion started by: go4desperado
4 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. Shell Programming and Scripting

Easy way to pull a paragraph from a text file?

I have a collection of text files that comprise a mailing list archive. I grep them to find an email that interests me, then open the file in a text editor to find the surrounding paragraph of text. Is there an easy way to do this from the shell instead? (2 Replies)
Discussion started by: CRGreathouse
2 Replies

5. Shell Programming and Scripting

Print each paragraph in a text file into excel file

Hi, I have a below text file, which needs to be printed into attached excel file. Please help me. Thanks (4 Replies)
Discussion started by: prash358
4 Replies

6. Windows & DOS: Issues & Discussions

Removing anything from text file except specific string

So, I have a text file that looks like this: 0,0: (168,168,176) #A8A8B0 srgb(168,168,176) 1,0: (168,168,176) #A8A8B0 srgb(168,168,176) 2,0: (166,166,174) #A6A6AE srgb(166,166,174) 3,0: (166,166,174) #A6A6AE srgb(166,166,174) 4,0: (168,168,176) #A8A8B0 srgb(168,168,176) 5,0:... (0 Replies)
Discussion started by: pasc
0 Replies

7. Shell Programming and Scripting

How to read all data after a specific string from a text file ?

Hi, I have a file(input.txt) and trying to format as output.txt. See the attached file format. Note: This is a windows file (DOS format) and the commands are also going to execute on windows. Basically I am trying to capture all the data in between Local Group Memberships and Global Group... (10 Replies)
Discussion started by: Monoj2014
10 Replies

8. Shell Programming and Scripting

Read paragraph from file

Hi, I have a file containing SQL commands in following format. I need to run the SQLs separately and also print the status of SQL, successful/unsuccessful. File : SQL.dat ## SQL1 select * from dual; ## SQL2 select user from dual10; Expected output: SQL1:PASS SQL2:FAIL Started... (3 Replies)
Discussion started by: bhupinder08
3 Replies

9. Shell Programming and Scripting

How to extract a paragraph containing a given string?

Hello: Have a very annoying problem: Need to extract paragraphs with a specific string in them from a very large file with a repeating record separator. Example data: a file called test.out CREATE VIEW view1 AS something FROM table1 ,table2 as A, table3 (something FROM table4) FROM... (15 Replies)
Discussion started by: delphys
15 Replies

10. Shell Programming and Scripting

Join Lines every paragraph in a file.txt

Hi all, Is there any idea on how to automate convert the paragraph in one line in a file, this will happen after OCR the documents, OCR split every paragraph. I need to join all the paragraph in one line. #cat file.txtThe Commission on Higher Education (CHED) was created through Republic Act... (7 Replies)
Discussion started by: lxdorney
7 Replies
fribidi_get_par_embedding_levels(3)				Programmer's Manual			       fribidi_get_par_embedding_levels(3)

NAME
fribidi_get_par_embedding_levels - get bidi embedding levels of a paragraph SYNOPSIS
#include <fribidi.h> FriBidiLevel fribidi_get_par_embedding_levels ( const FriBidiCharType *bidi_types, const FriBidiStrIndex len, FriBidiParType *pbase_dir, FriBidiLevel *embedding_levels ); PARAMETERS
const FriBidiCharType *bidi_types Input list of bidi types as returned by fribidi_get_bidi_types(). Possible values for a const FriBidiCharType are as follows: FRIBIDI_TYPE_LTR Left-To-Right letter. FRIBIDI_TYPE_RTL Right-To-Left letter. FRIBIDI_TYPE_AL Arabic Letter. FRIBIDI_TYPE_EN European Numeral. FRIBIDI_TYPE_AN Arabic Numeral. FRIBIDI_TYPE_ES European number Separator. FRIBIDI_TYPE_ET European number Terminator. FRIBIDI_TYPE_CS Common Separator. FRIBIDI_TYPE_NSM Non Spacing Mark. FRIBIDI_TYPE_BN Boundary Neutral. FRIBIDI_TYPE_BS Block Separator. FRIBIDI_TYPE_SS Segment Separator. FRIBIDI_TYPE_WS WhiteSpace. FRIBIDI_TYPE_ON Other Neutral. FRIBIDI_TYPE_LRE Left-to-Right Embedding. FRIBIDI_TYPE_RLE Right-to-Left Embedding. FRIBIDI_TYPE_LRO Left-to-Right Override. FRIBIDI_TYPE_RLO Right-to-Left Override. FRIBIDI_TYPE_PDF Pop Directional Flag. const FriBidiStrIndex len Input string length of the paragraph. FriBidiParType *pbase_dir Requested and resolved paragraph base direction. Possible values for a FriBidiParType are as follows: FRIBIDI_PAR_LTR Left-To-Right paragraph. FRIBIDI_PAR_RTL Right-To-Left paragraph. FRIBIDI_PAR_ON DirectiOn-Neutral paragraph. FRIBIDI_PAR_WLTR Weak Left To Right paragraph. FRIBIDI_PAR_WRTL Weak Right To Left paragraph. FriBidiLevel *embedding_levels Output list of embedding levels. DESCRIPTION
This function finds the bidi embedding levels of a single paragraph, as defined by the Unicode Bidirectional Algorithm available at http://www.unicode.org/reports/tr9/. This function implements rules P2 to I1 inclusive, and parts 1 to 3 of L1, except for rule X9 which is implemented in fribidi_remove_bidi_marks(). Part 4 of L1 is implemented in fribidi_reorder_line(). There are a few macros defined in fribidi-bidi-types.h to work with this embedding levels. RETURNS
Maximum level found plus one, or zero if any error occured (memory allocation failure most probably). SEE ALSO
fribidi_charset_to_unicode(3), fribidi_unicode_to_charset(3), fribidi_parse_charset(3), fribidi_shape_arabic(3), fribidi_get_par_direc- tion(3), fribidi_reorder_line(3), fribidi_get_bidi_type(3), fribidi_get_bidi_types(3), fribidi_get_bidi_type_name(3), fribidi_debug_sta- tus(3), fribidi_mirroring_status(3), fribidi_set_mirroring(3), fribidi_reorder_nsm_status(3), fribidi_set_reorder_nsm(3), fribidi_log2vis_get_embedding_levels(3), fribidi_get_type(3), fribidi_get_type_internal(3), fribidi_remove_bidi_marks(3), fribidi_log2vis(3), fribidi_join_arabic(3), fribidi_get_joining_type(3), fribidi_get_joining_types(3), fribidi_get_joining_type_name(3), fribidi_get_mirror_char(3), fribidi_shape_mirroring(3), fribidi_shape(3) GNU FriBidi 0.19.2 30 January 2006 fribidi_get_par_embedding_levels(3)
All times are GMT -4. The time now is 08:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy