Sponsored Content
Top Forums Shell Programming and Scripting Create multiple text file from a single text file on AIX Post 302372517 by lodhi1978 on Wednesday 18th of November 2009 06:39:54 AM
Old 11-18-2009
Quote:
Originally Posted by Franklin52
Code:
awk '/A\/C NO. TYPE\/CCY :/{f=$(NF-1)}f{print > f}' unixfile

.
Files generated with A/C No. as required, but the initial 2 lines of every statement missed in newly created text files. i.e.

TITLE OF ACCOUNT : MUHAMMAD RASHID STATEMENT DATE : 18/11/2009 00:18:07^M
MUHAMMAD RASHID STATEMENT PERIOD : 01-NOV-09 - 30-NOV-09^M

I tried to create the files as below

Code:
awk '/TITLE OF ACCOUNT ://A\/C NO. TYPE\/CCY :/{f=$(NF-1)}f{print > f}' rba141_15828820.eod.txt

it gave me following error: Smilie
Syntax Error The source line is 1.
The error context is
/TITLE OF ACCOUNT >>> ://A\ <<< /C NO. TYPE\/CCY :/{f=$(NF-1)}f{print > f}
awk: 0602-500 Quitting The source line is 1.

Actually I want to named the file as A/C Number while data should start from Title of Account.

Regards,

Hassan
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep multiple text files in folder into 1 text file?

How do I use the grep command to take mutiple text files in a folder and make one huge text file out of them. I'm using Mac OS X and can not find a text tool that does it so I figured I'd resort to the BSD Unix CLI for a solution... there are 5,300 files that I want to write to one huge file so... (7 Replies)
Discussion started by: coppertone
7 Replies

2. Shell Programming and Scripting

Need to remove multiple text from a single file

Dear all, I have a file which have let us say records from A-Z. Now I want to remove multiple letter from this file using single command.. let us say I want to remove A,F,K,Y,U,P,B,S,D. I can use grep -v command but for this case i need to rerun the file several time i wana avoid using... (3 Replies)
Discussion started by: jojo123
3 Replies

3. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

4. Shell Programming and Scripting

Script to create a text file whose content is the text of another files

Hello everyone, I work under Ubuntu 11.10 (c-shell) I need a script to create a new text file whose content is the text of another text files that are in the directory $DIRMAIL at this moment. I will show you an example: - On the one hand, there is a directory $DIRMAIL where there are... (1 Reply)
Discussion started by: tenteyu
1 Replies

5. UNIX for Dummies Questions & Answers

How to grep multiple lines from a text file using another text file?

I would like to use grep to select multiple lines from a text file using a single-column text file. Basically I want to only select lines from the first text file where the second column of the first text file matches the second text file. How do I go about doing that? Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies

6. UNIX for Dummies Questions & Answers

Changing text in multiple files, but with different text for each file

Hello, I have a situation where I want to change a line of text in multiple files, but the problem is that I want to change the text to something unique for each file. For example, let's say I have five files named bob.txt, joe.txt, john.txt, tom.txt, and zach.txt. Each of these files has a... (5 Replies)
Discussion started by: Scatterbrain26
5 Replies

7. Shell Programming and Scripting

Split a text file into multiple text files?

I have a text file with entries like 1186 5556 90844 7873 7722 12 7890.6 78.52 6679 3455 9867 1127 5642 ..N so many records like this. I want to split this file into multiple files like cluster1.txt, cluster2.txt, cluster3.txt, ..... clusterN.txt. (4 Replies)
Discussion started by: sammy777
4 Replies

8. UNIX for Dummies Questions & Answers

Pdftotext from multiple pdf files to a single text file

I have a directory having a number of pdf files. I want to convert all the files to text, stored in a single text file The following creates multiple text files ls *.pdf | xargs -n1 pdftotext (1 Reply)
Discussion started by: kristinu
1 Replies

9. Shell Programming and Scripting

Create multiple files from single file based on row separator

Hello , Can anyone please help me to solve the below - Input.txt source table abc col1 char col2 number source table bcd col1 date col2 char output should be 2 files based on the row separator "source table" abc.txt col1 char (6 Replies)
Discussion started by: Pratik4891
6 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
Boulder::Medline(3pm)					User Contributed Perl Documentation				     Boulder::Medline(3pm)

NAME
Boulder::Medline - Fetch Medline data records as parsed Boulder Stones SYNOPSIS
# parse a file of Medline records $ml = new Boulder::Medline(-accessor=>'File', -param => '/data/medline/medline.txt'); while (my $s = $ml->get) { print $s->Identifier; print $s->Abstract; } # parse flatfile yourself open (ML,"/data/medline/medline.txt"); local $/ = "*RECORD*"; while (<ML>) { my $s = Boulder::Medline->parse($_); # etc. } DESCRIPTION
Boulder::Medline provides retrieval and parsing services for Medline records Boulder::Medline provides retrieval and parsing services for NCBI Medline records. It returns Medline entries in Stone format, allowing easy access to the various fields and values. Boulder::Medline is a descendent of Boulder::Stream, and provides a stream-like interface to a series of Stone objects. Access to Medline is provided by one accessors, which give access to local Medline database. When you create a new Boulder::Medline stream, you provide the accessors, along with accessor-specific parameters that control what entries to fetch. The accessors is: File This provides access to local Medline entries by reading from a flat file. The stream will return a Stone corresponding to each of the entries in the file, starting from the top of the file and working downward. The parameter is the path to the local file. It is also possible to parse a single Medline entry from a text string stored in a scalar variable, returning a Stone object. Boulder::Medline methods This section lists the public methods that the Boulder::Medline class makes available. new() # Local fetch via File $ml=new Boulder::Medline(-accessor => 'File', -param => '/data/medline/medline.txt'); The new() method creates a new Boulder::Medline stream on the accessor provided. The only possible accessors is File. If successful, the method returns the stream object. Otherwise it returns undef. new() takes the following arguments: -accessor Name of the accessor to use -param Parameters to pass to the accessor Specify the accessor to use with the -accessor argument. If not specified, it defaults to File. -param is an accessor-specific argument. The possibilities is: For File, the -param argument must point to a string-valued scalar, which will be interpreted as the path to the file to read Medline entries from. get() The get() method is inherited from Boulder::Stream, and simply returns the next parsed Medline Stone, or undef if there is nothing more to fetch. It has the same semantics as the parent class, including the ability to restrict access to certain top-level tags. put() The put() method is inherited from the parent Boulder::Stream class, and will write the passed Stone to standard output in Boulder format. This means that it is currently not possible to write a Boulder::Medline object back into Medline flatfile form. OUTPUT TAGS
The tags returned by the parsing operation are taken from the MEDLARS definition file MEDDOC.DOC Top-Level Tags These are tags that appear at the top level of the parsed Medline entry. ABSTRACT ABSTRACT AUTHOR ADDRESS AUTHOR CALL NUMBER CAS REGISTRY/EC NUMBER CLASS UPDATE DATE COMMENTS COUNTRY DATE OF ENTRY DATE OF PUBLICATION ENGLISH ABSTRACT INDICATOR ENTRY MONTH GENE SYMBOL ID NUMBER INDEXING PRIORITY ISSN ISSUE/PART/SUPPLEMENT JOURNAL SUBSET JOURNAL TITLE CODE LANGUAGE LAST REVISION DATE MACHINE-READABLE IDENTIFIER MeSH HEADING NO-AUTHOR INDICATOR NOT FOR PUBLICATION NUMBER OF REFERENCES PAGINATION PERSONAL NAME AS SUBJECT PUBLICATION TYPE RECORD ORIGINATOR SECONDARY SOURCE ID SPECIAL LIST INDICATOR TITLE TITLE ABBREVIATION TRANSLITERATED/VERNACULAR TITLE UNIQUE IDENTIFIER VOLUME ISSUE Identifier The Medline identifier of this entry. Identifier is a single-value tag. Example: my $identifierNo = $s->Identifier; Title The Medline title for this entry. Example: my $titledef=$s->Title; SEE ALSO
Boulder, Boulder::Blast, Boulder::Genbank AUTHOR
Lincoln Stein <lstein@cshl.org>. Luca I.G. Toldo <luca.toldo@merck.de> Copyright (c) 1997 Lincoln D. Stein Copyright (c) 1999 Luca I.G. Toldo This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty. perl v5.10.1 2011-03-05 Boulder::Medline(3pm)
All times are GMT -4. The time now is 04:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy