Sponsored Content
Top Forums Shell Programming and Scripting I want Trailer to be added into the text file. Post 302303222 by cfajohnson on Thursday 2nd of April 2009 07:04:13 AM
Old 04-02-2009
Quote:
Originally Posted by Haque123
Folks i have this comand

Please put code inside [code] tags.
Quote:
Code:
get_records=`wc -l abc.txt'
echo "Trailer|"$reds


Do you mean:

Code:
echo "Trailer|$get_records"

Quote:

after running the above comands I get the o/p as

Trailer| 200 abc


suggest How do I remove the file name abc from the o/p and also a space after TRL|' '

I was expect the o/p as Trailer|200
Code:
get_records=`wc -l < abc.txt`
echo "Trailer|$get_records"

Or:

Code:
get_records=$(( `wc -l < abc.txt` ))
echo "Trailer|$get_records"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Removing trailer from a flat file!!!

Hi, I get some flat files with trailer which gives the totol records count and i want to remove the trailer from the file. i used the following command it works fine with a single file. cat file_name | grep -v 'Total records:' > file1 mv file file_name But i dont know how to remove the... (12 Replies)
Discussion started by: kumarsaravana_s
12 Replies

2. Shell Programming and Scripting

Get the latest added part of a text file?

Hi, I want to get the latest added part of a text file sent over the network to for analysis. Is there a tool to use to keep track of which part of a text file that has already been analysed so only the "new" lines will be sent and handled? I have checked a few tools but I still donīt know how to... (3 Replies)
Discussion started by: pcrs
3 Replies

3. Shell Programming and Scripting

Merge text files while combining the multiple header/trailer records into one each.

Situation: Our system currently executes a job (COBOL Program) that generates an interface file to be sent to one of our vendors. Because this system processes information for over 100,000 employees/retirees (and growing), we'd like to multi-thread the job into processing-groups in order to... (4 Replies)
Discussion started by: oordonez
4 Replies

4. Shell Programming and Scripting

Removing Header & Trailer from a file

Hi All, I am karthik. I am new to this forum. I have one requirement. I have a file with header and footer. Header may be like HDR0001 or FILE20090110 (Assume it is unknown so far, but i am sure there is a header in the file) likewise file has the trailer too. I just... (7 Replies)
Discussion started by: karthi_gana
7 Replies

5. Shell Programming and Scripting

Need to echo a text where a (.) is added to the end of line during on-going copy or ftp

Hello All, I would like to create a script to echo a text where a (.) dot is added every 2 seconds to the end of this text (with a limit of 10 dots) as long as a file copy or ftp is ongoing and once the copy is finished it adds "done" to the end of this text line. please see the below example: ... (6 Replies)
Discussion started by: Dendany83
6 Replies

6. UNIX for Dummies Questions & Answers

Adding header and trailer into a file

Hi, I want to add the below Header to all the files in sequence File1,File2,File3...etc "ABC,<number of chracter in the file>" e,g - If File1 is as below pqrstuvdt abcdefgh then I want to add the above header into it ,So that File1 becomes as below ABC,17 pqrstuvdt abcdefgh ... (9 Replies)
Discussion started by: spari2
9 Replies

7. Shell Programming and Scripting

Script to validate file header and trailer

Hi, I need a script that validates a file header/detail/trailer. File layout is: Header - Rec_Type|File_name|File_Date Detail - Rec_Type|field1|field2|field3... Trailder - Rec_Type|File_name|File_Date|Record_count Sample Data: HDR|customer_data.dat|20120709... (7 Replies)
Discussion started by: ash_sh
7 Replies

8. Shell Programming and Scripting

Verify the header and trailer in file

please see my requirement, I hope I am clear. (9 Replies)
Discussion started by: mirwasim
9 Replies

9. Programming

Dynamically added text fields passed to PHP script

If I am posting this to the wrong section please move it somewhere it fits. I apologize if this is not the correct section. I have a site where I want to have form that in a "Visitor name" section to be able to add fieldets as needed. I think I have that worked out. So the below code is the... (4 Replies)
Discussion started by: GroveTuckey
4 Replies

10. UNIX for Dummies Questions & Answers

Sending mail to multiple recipient added in a text file

I am trying to find a code that can help me mail to a list of recipients which are in a text file. Sample code $cat recipient.txt me@test.com me1@test.com me2@test.com I want a mailx step that can read contents of recipient.txt and mail to all the users. I don't want to use mails... (1 Reply)
Discussion started by: Gurkamal83
1 Replies
Boulder::Omim(3pm)					User Contributed Perl Documentation					Boulder::Omim(3pm)

NAME
Boulder::Omim - Fetch Omim data records as parsed Boulder Stones SYNOPSIS
# parse a file of Omim records $om = new Boulder::Omim(-accessor=>'File', -param => '/data/omim/omim.txt'); while (my $s = $om->get) { print $s->Identifier; print $s->Text; } # parse flatfile records yourself open (OM,"/data/omim/omim.txt"); local $/ = "*RECORD*"; while (<OM>) { my $s = Boulder::Omim->parse($_); # etc. } DESCRIPTION
Boulder::Omim provides retrieval and parsing services for OMIM records Boulder::Omim provides retrieval and parsing services for NCBI Omim records. It returns Omim entries in Stone format, allowing easy access to the various fields and values. Boulder::Omim is a descendent of Boulder::Stream, and provides a stream-like interface to a series of Stone objects. Access to Omim is provided by one accessors, which give access to local Omim database. When you create a new Boulder::Omim 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 Omim entries by reading from a flat file (typically omim.txt file downloadable from NCBI's Ftp site). 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 Omim entry from a text string stored in a scalar variable, returning a Stone object. Boulder::Omim methods This section lists the public methods that the Boulder::Omim class makes available. new() # Local fetch via File $om=new Boulder::Omim(-accessor => 'File', -param => '/data/omim/omim.txt'); The new() method creates a new Boulder::Omim 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 Omim entries from. get() The get() method is inherited from Boulder::Stream, and simply returns the next parsed Omim 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::Omim object back into Omim flatfile form. OUTPUT TAGS
The tags returned by the parsing operation are taken from the names shown in the network Entrez interface to Omim. Top-Level Tags These are tags that appear at the top level of the parsed Omim entry. Identifier The Omim identifier of this entry. Identifier is a single-value tag. Example: my $identifierNo = $s->Identifier; Title The Omim title for this entry. Example: my $titledef=$s->Title; Text The Text of this Omim entry Example: my $thetext=$s->Text; Mini The text condensed version, also called "Mini" in Entrez interface Example: my $themini=$s->Mini; SeeAlso References to other relevant work. Example: my $thereviews=$s->Reviews; CreationDate This field contains the name of the person who originated the initial entry in OMIM and the date it appeared in the database. The entry may have been subsequently added to, edited, or totally rewritten by others, and their attribution is listed in the CONTRIBUTORS field. Example: my $theCreation=$s->CreationDate; Contributors This field contains a list, in chronological order, of the persons who have contributed significantly to the content of the MIM entry. The name is followed by "updated", "edited" or "re-created". Example: my @theContributors=$s->Contributors; History This field contains the edit history of this record, with an identifier and a date in which minor changes had been performed on the record. Example: my @theHistory=$s->History; References The references cited in the entry. Example: my @theReferences=$s->References; ClinicalSynopsis The content of the Clinical Synopsis data field. Example: my @theClinicalSynopsis=$s->ClinicalSynopsis; AllelicVariants The Allelic Variants Example: my @theAllelicVariants=$s->AllelicVariants; 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 2000-01-18 Boulder::Omim(3pm)
All times are GMT -4. The time now is 08:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy