Sponsored Content
Top Forums Shell Programming and Scripting how to read a file till it encounters a blank line Post 302147207 by adityam on Monday 26th of November 2007 01:10:47 AM
Old 11-26-2007
how to read a file till it encounters a blank line

Hi ,
I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this.

e.g:-
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid use of FirmA

* PK sent email (11.20)
CALYPSO 1238957 9088029 ONRUNDEL FAILED Nov 20 2007 8:04AM OASYS: Unable to find CUSTOMER account BS


Here I need to read from * until it encounters a blank line.

My output should be

* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid use of FirmA



Thanks,
Aditya
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need to read a file and keep waiting till it satisfies some condition

In my script i am writing to a counter file the no of processes i had started, that is each time i start a process, i will increment the content of counter file and also when the process ends i will decrement the content of the file. after this i do some other activities, by now i want to... (1 Reply)
Discussion started by: senthilk615
1 Replies

2. Post Here to Contact Site Administrators and Moderators

how to read a file till it encounters a blank line

Hi , I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this. e.g:- * PK Sent Email (11.23) CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS:... (0 Replies)
Discussion started by: adityam
0 Replies

3. UNIX for Dummies Questions & Answers

how to read a file till it encounters a blank line

Hi , I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this. e.g:- * PK Sent Email (11.23) CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid... (1 Reply)
Discussion started by: adityam
1 Replies

4. UNIX for Dummies Questions & Answers

Read lines till a blank line is encountered

Hi, I have reached at a specified offset from the start of file. My requirement is that I want to read only those lines, which have the string READ / ALTER / UPDATE. As soon as, none of these literals are found in the subsequent line, I want to stop reading. Is there any feature of grep which... (1 Reply)
Discussion started by: saurabhsinha23
1 Replies

5. Shell Programming and Scripting

[Solved] Read a line from one string till to another.... Unix scripting..

So i have a file which contains paths to JPG images separated by a space. I have to separate them each path to another file. So, I have to search all strings that start from /home/ and ends with .jpg or .png Then write each one to another file... Can you please help me on doing this???:cool: (11 Replies)
Discussion started by: hakermania
11 Replies

6. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

7. Shell Programming and Scripting

Awk script to match pattern till blank line

Hi, I need to match lines after a pattern, upto the first blank line. Searched in web and some forums but coulnt find the answer. where <restart_step> = 10 -- Execute query 20 -- Write the contents to the Oracle table 30 -- Writing Contents to OUTPUT... (7 Replies)
Discussion started by: justchill
7 Replies

8. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

9. Shell Programming and Scripting

Bash script to read a file from particular line till required line and process

Hi All, Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool. Wraper script am trying is to do with above metion 2 files. utility tool accepts : a. userinfo file : which contains username b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies

10. Shell Programming and Scripting

Combine multiline to one line till a blank line

Hello, I have a file as :- ABC DEF GHI JKL <BlankLine> MNO PQR STU VWX <BlankLine> YZA I need it as below:- ABCDEFGHIJKL; MNOPQRSTUVWX; (3 Replies)
Discussion started by: jassi10781
3 Replies
PS2FAX(8C)																PS2FAX(8C)

NAME
ps2fax - image POSTSCRIPT(R) for facsimile transmission by HylaFAX SYNOPSIS
/var/spool/fax/bin/ps2fax [ options ] [ files... ] DESCRIPTION
ps2fax takes POSTSCRIPT input and generates a TIFF Class F image file suitable for facsimile transmission. It is usually invoked by the HylaFAX scheduler process, faxq(8C). On Silicon Graphics' IRIX systems, this application is based on Adobe's Display POSTSCRIPT software. On other machines POSTSCRIPT imaging is typically done using the freely available Ghostscript software. ps2fax is actually a link (symbolic or otherwise) to the script appropriate for the POSTSCRIPT imaging tool. The link is setup when the faxsetup(8C) script is run to configure a HylaFAX server machine for use. Input files containing POSTSCRIPT may be specified on the command line. If none are given, then ps2fax will read from standard input. By default, ps2fax will generate a 98 line/inch output document whose page width is 1728 pixels and page length is 297 mm (a standard A4 page at low resolution). Horizontal resolution is always 204 dpi. Command line options may be used to select alternate vertical resolu- tion and page dimensions. If no filename is given, ps2fax writes its output to a file named ps.fax; the -o option can be used to specify an alternate filename. By default, output is compressed using the standard Group 3 1D-encoding scheme, with EOL codes padded to byte boundaries. If the -2 option is specified, output is encoded with the optional Group 3 2D-encoding scheme (EOL codes are still padded to byte boundaries). This script can modify outgoing facsimile, such as watermarking, To do this create a shell script etc/FaxModify in the spooling area that alters the document. Note that bin/ps2fax is usually just a link to a shell script that invokes the appropriate POSTSCRIPT RIP to do the work. OPTIONS
The following operations are recognized: -1 Write Group 3 1D-encoded data to the output file. -2 Write Group 3 2D-encoded data to the output file. -3 Write Group 4 MMR-encoded data to the output file. -m pages Set the maximum number of pages that are permitted in the output file. If more pages are present in the input document then abort processing. -o file Write output to the specified file instead of the default ps.fax filename. -w width Set the output page width, in pixels. By default, pages are 1728 pixels wide. -l length Set the output page length in millimeters. By default, pages are 297 millimeters long. -r vres Set the vertical resolution, in lines/inch, at which to image the POSTSCRIPT. RUNTIME ENVIRONMENT
Before user-supplied POSTSCRIPT is passed to the POSTSCRIPT interpreter, a limited number of operators are defined. These operators are operators commonly found in a LaserWriter printer and (sometimes) generated by Macintosh-based applications. The default Display POSTSCRIPT-based execution environment includes support for the following fonts: AvantGarde-Book Helvetica-Bold Palatino-BoldItalic AvantGarde-BookOblique Helvetica-BoldOblique Palatino-Italic AvantGarde-Demi Helvetica-Narrow Palatino-Roman AvantGarde-DemiOblique Helvetica-Narrow-Bold StoneSerif Bookman-Demi Helvetica-Narrow-BoldOblique Symbol Bookman-DemiItalic Helvetica-Narrow-Oblique Tekton Bookman-Light Helvetica-Oblique Times-Bold Bookman-LightItalic Lithos-Bold Times-BoldItalic Courier NewCenturySchlbk-Bold Times-Italic Courier-Bold NewCenturySchlbk-BoldItalic Times-Roman Courier-BoldOblique NewCenturySchlbk-Italic ZapfChancery-MediumItalic Courier-Oblique NewCenturySchlbk-Roman ZapfDingbats Helvetica Palatino-Bold Note that this is the same set of fonts supported by the DPS extension to the X server. The default Ghostscript-based environment is more uncertain; consult the Ghostscript documentation for information on what fonts are avail- able. FILES
/var/spool/fax/etc/dpsprinter.ps POSTSCRIPT code read at startup for DPS /usr/lib/DPS/default.dps_vm startup VM file for DPS /usr/lib/DPS/outline Type 1 fonts for DPS /usr/lib/DPS/prebuilt prebuilt versions of fonts for DPS BUGS
Output from the Display POSTSCRIPT version of this command is encoded according to the Display POSTSCRIPT binary encoding protocol. No prebuilt bitmap fonts are currently available for the DPS-based imager; this would greatly improve legibility at low resolutions, as the rendering of outline fonts at 98 lpi is particularly poor. Both DPS- and Ghostscript-based versions of this program fail to exit with non-zero status when an invalid POSTSCRIPT document is pro- cessed; this makes it problematic for the HylaFAX queue manager to determine when a problem arises when preparing a job for transmission. SEE ALSO
sendfax(1), faxq(8C), hylafax-server(5F) August 26, 1996 PS2FAX(8C)
All times are GMT -4. The time now is 09:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy