Sponsored Content
Top Forums Shell Programming and Scripting How to extract some parts of a file to create some outfile Post 302314450 by ghostdog74 on Friday 8th of May 2009 10:26:48 AM
Old 05-08-2009
Quote:
Originally Posted by iammitra
Hallo ghostdog74,
Thanks for your reply. But I am sorry to say that I forgot to mention : in my input file there are not always only 6 lines. I just copied some lines.. This lines varies from 100 to 200. So it is necessary for the program to read +++++++++End.

Thanks a lot,
Mitra.
well, i am not sure i get you, but i see other solutions include "End', therefore if you are sure that ++++++++ is not unique, you can add "End"
Code:
....
if line.startswith("+++++++++++End"): 
....

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract columns from 2 different files and create new file

Hi All, I have 2 issues while working with file. 1. I have 2 delimited(~) files. I want to extract column numbner 3 from file1 and column number 8 from file2 and paste it into file3. I have tried using cut, but not able to get answer. 2. i have 2 filxed-width file. I wanted to do same... (1 Reply)
Discussion started by: Amit.Sagpariya
1 Replies

2. Shell Programming and Scripting

Extract date from filename and create a new file

Hi, i have a filename CRED20102009.txt in a server 20102009 is the date of the file ddmmaaaa format the complete route is /dprod/informatica/Fuentes/CRED20102009.csv i want to extract the date to create a new file named Parameters.txt I need to create Parameters.txt with this... (6 Replies)
Discussion started by: angel1001
6 Replies

3. Shell Programming and Scripting

Create shell script to extract unique information from one file to a new file.

Hi to all, I got this content/pattern from file http.log.20110808.gz mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1 mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies

4. Shell Programming and Scripting

awk? create similarity matrix by calculating overlaps between sets comprising of individual parts

Hi everyone I am very new at awk and to me the task I need to get done is very very challenging... Nevertheless, after admiring how fast and elegant issues are being solved here I am sure this is my best chance. I have a 2D data file (input file is a plain tab-delimited text file). The first... (1 Reply)
Discussion started by: stonemonkey
1 Replies

5. Shell Programming and Scripting

extract certain parts from a file

I have a logfile from which i need to extract certain pattern based on the time but the problem here is the time is not same for all days. Input file: Mon 12:34:56 abvjingjgg Mon 12:34:57 ofjhjgjhgh . . . Mon 22:30:00 kkfng . . . Mon 23:12:23 kjgsdafhkljf . . . Tue 01:04:54... (8 Replies)
Discussion started by: gpk_newbie
8 Replies

6. Shell Programming and Scripting

Extract Parts of File

Hello All, I have a file like this Define schema flat_file_schema ( a varchar(20) ,b varchar(30) ,c varchar(40) ); (Insert into table ( a ,b ,c ) values ( 1 ,2 ,3 ); (4 Replies)
Discussion started by: nnani
4 Replies

7. Shell Programming and Scripting

Incrementing parts of ten digits number by parts

I have number in file which contains date and serial number: 2013101000. The last two digits are serial number (00). So maximum of serial number is 100. After reaching 100 it becomes 00 with incrementing 10 which is day with max 31. after reaching 31 it becomes 00 and increments 10... (31 Replies)
Discussion started by: Natalie
31 Replies

8. Solaris

Solaris 10 error "-sh: /tmp/outfile: cannot create"

Hello, Each time a user log on to host, they receive below error: -sh: /tmp/outfile: cannot create Example: $ ssh host user@host's password: Last login: Fri Dec 4 08:17:28 2015 from client.ref |-----------------------------------------------------------------| -sh:... (2 Replies)
Discussion started by: feroccimx
2 Replies

9. Shell Programming and Scripting

Extract parts of the line

I have a long list of lines in a txt file which i'm only interested to extract the list of domains like the colored ones. domain.com domain.com/page codes $.09 domain.org domain.org/page2/ codes $0.10 domain.net domain.net/page03 codes $0.05 domain.info ... (3 Replies)
Discussion started by: garfish
3 Replies

10. UNIX for Beginners Questions & Answers

TCL script to extract the file name and then create two independent list

I am having one problem as stated below Problem Description I am having some "sv" extension files , I am using "glob" to extract the matching files , Now in these matching files , I need to split them and extract the elements and create different lists. For example set files This... (1 Reply)
Discussion started by: kshitij
1 Replies
me(5)								File Formats Manual							     me(5)

NAME
me - Macros for formatting papers SYNOPSIS
nroff -me [options] file... DESCRIPTION
This package of nroff macro definitions provides a formatting facility for technical papers in various formats. When producing two-column output on a terminal, filter the output through col. Many nroff requests are unsafe in conjunction with this package; however, the following requests can be used with impunity after the first .bp Begin a new page. .br Break the output line here. .ce n Center the next n lines. .ls n Use line spacing: n=1 single, n=2 double space. .na Do not justify (align) the right margin. .sp n Insert n spacing lines. .sz +n Add n to the point size. .ul n Underline the next n lines. Output of the neqn and tbl preprocessors for equations and tables is acceptable as input. REQUESTS
In the following list, initialization refers to the first macro. This list is incomplete. ------------------------------------------------------------------------- Request Initial Cause Explanation Value Break ------------------------------------------------------------------------- .(b - yes Begin block. .(c - yes Begin centered block. .(d - no Begin delayed text. .(f - no Begin footnote. .(l - yes Begin list. .(q - yes Begin major quote. .(x x - no Begin indexed item in index. .(z - no Begin floating keep. .)b - yes End block. .)c - yes End centered block. .)d - yes End delayed text. .)f - yes End footnote. .)l - yes End list. .)q - yes End major quote. .)x - yes End index item. .)z - yes End floating keep. .++ m H - no Define paper section. m defines the part of the paper, and can be C (chapter), A (appendix), P (prelim- inary information, for example, an abstract, table of contents, and so on), B (bibliography), RC (chapters renumbered from page one each chap- ter), or RA (appendix renumbered from page one). .+c T - yes Begin chapter (or appendix, etc., as set by T is the chapter title. .1c 1 yes One-column format on a new page. .2c 1 yes Two-column format. .EN - yes Space after equation produced by neqn. .EQ x y - yes Precede equation; break out and add space. Equation number is y. The optional argument x may be I to indent equation (default), L to left-adjust the equation, or C to center the equation. .TE - yes End table. .TH - yes End heading section of table. .TS x - yes Begin table; if x is H, table has repeated heading. .ac A N - no Set up for ACM style output. A is the Author's name(s), N is the total number of pages. Must be given before the first initializa- tion. .b x no no Print x in boldface; if there is no argument, switch to boldface. .ba +n 0 yes Augment the base indent by n. This indent is used to set the indent on regular text (like paragraphs). .bc no yes Begin new column. .bi x no no Print x in bold italics (nofill only). .bx x no no Print x in a box (nofill only). .ef 'x'y'z' '''' no Set even footer to x y z. .eh 'x'y'z' '''' no Set even header to x y z. .fo 'x'y'z' '''' no Set footer to x y z. .he 'x'y'z' '''' no Set header to x y z. .hl - yes Draw a horizontal line. .hx - no Suppress headers and footers on next page. .i x no no Italicize x; if x missing, italic text follows. .ip x y no yes Start indented paragraph, with hanging tag x. Indentation is y ens (default 5). .lp yes yes Start left-blocked paragraph. .lo - no Read in a file of local macros of the form .np 1 yes Start numbered paragraph. .of 'x'y'z' '''' no Set odd footer to x y z. .oh 'x'y'z' '''' no Set odd header to x y z. .pd - yes Print delayed text. .pp no yes Begin paragraph. First line indented. .r yes no Roman text follows. .re - no Reset tabs to default values. .sc no no Read in a file of special charac- ters and diacritical marks. Must be given before initialization. .sh n x - yes Section head follows, font automat- ically bold. n is level of sec- tion, x is title of section. .sk no no Leave the next page blank. Only one page is remembered ahead. .sz +n 10p no Augment the point size by n points. .th no no Produce the paper in thesis format. Must be given before initializa- tion. .tp no yes Begin title page. .u x - no Underline argument (nofill only). .uh - yes Like .xp x - no Print index x. ------------------------------------------------------------------------- FILES
The me macro package source file Supplemental me macros. SEE ALSO
col(1), neqn(1), nroff(1), tbl(1) me(5)
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy