Sponsored Content
Top Forums Shell Programming and Scripting Add header and footer with record count in footer Post 302612157 by kevintse on Saturday 24th of March 2012 11:45:10 PM
Old 03-25-2012
I assume the first row is the current date.
Code:
awk 'BEGIN{"date +%m%d%Y" | getline first; print "1|" first} {if(NR>1){print "2|"$0}else{print "1|"$0} ++c}END{print "3|"c}' infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to Chop Header and Footer record from input file

Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
Discussion started by: coolbudy
4 Replies

2. Shell Programming and Scripting

Split large file and add header and footer to each file

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (1 Reply)
Discussion started by: ashish4422
1 Replies

3. Shell Programming and Scripting

Split large file and add header and footer to each small files

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (7 Replies)
Discussion started by: ashish4422
7 Replies

4. Shell Programming and Scripting

Inserting Header and footer

Hi All, I have several txt files i need to enter specific header and footer (both are separate) to all these files how can i do this? plz help.. Regards, Raghav (4 Replies)
Discussion started by: digitalrg
4 Replies

5. Shell Programming and Scripting

How to add header and footer?

Hi, Guys, I want add header and footer in a file. I can add footer using following command: echo "Footer" >>file. I don't know how to add header. Thanks in advance (4 Replies)
Discussion started by: ken002
4 Replies

6. UNIX for Dummies Questions & Answers

Help with the Header and Footer check

Hi, I need to check whether the incoming file has a header and footer using a UNIX script. The pattern of the header and footer is fixed as follows: Header: Name,Date Footer: Count, Total Name,Date ------------------------- ------------------------- ------------------------- Count,... (5 Replies)
Discussion started by: Sunny_teotia
5 Replies

7. Shell Programming and Scripting

Header and Footer...

Hi All, I need to write a script that In my file I have to check header and footer records are available or not. If it is available I have to run the script, otherwise I should not. But current script it is checking only the data inside the script. It is avoiding to check Header and Footer... (1 Reply)
Discussion started by: suresh_target
1 Replies

8. Shell Programming and Scripting

Removing header and footer

I have two files which are getting sent to a UNIX server in order to be bcp'd into a database. The bcp is failing because there's a header and footer row on the file which give the date of the file and the number of rows in it. That's because the file is also being used for another process, so we... (1 Reply)
Discussion started by: Tom Sawyer
1 Replies

9. UNIX for Dummies Questions & Answers

File Row Line Count without Header Footer

Hi There! I am saving the file count of all files in a directory to an output file using: wc -l * > FileCount.txt I get: 114 G4SXORD 3 G4SXORH 0 G4SXORP 117 total But this count includes header and footer. I want to subtract 2 from the count and get ... (7 Replies)
Discussion started by: gagan8877
7 Replies

10. Shell Programming and Scripting

Strip header and footer

Hi I have below requirements on the script below : (1) I receive 2 pipe seperated file called OUT.psv and DIFF.psv with a column header.I concatenate the 2 files and create a final.psv file. I want to add another header as START_FILE to the final.psv file . How to achieve this ? (2) I have... (5 Replies)
Discussion started by: samrat dutta
5 Replies
NetApp::Filer::Version(3pm)				User Contributed Perl Documentation			       NetApp::Filer::Version(3pm)

NAME
NetApp::Filer::Version -- OO Class for representing NetApp Filer versions SYNOPSIS
use NetApp::Filer; my $filer = NetApp::Filer->new({ ... }); # The "version" is: NetApp Release 7.2.2: Sat Mar 24 20:38:59 PDT 2007 my $version = $filer->get_version; # $version->isa("NetApp::Filer::Version") print $version->get_release, " "; # prints "7.2.2" print $version->get_date, " "; # prints "Sat Mar 24 20:38:59 PDT 2007" print $version->get_string, " "; print "$version "; # Both print the same thing, the second one through operator overloading, # namely the original, unparsed version string print $version->get_version, " "; # prints "v7.2.2" DESCRIPTION
This class is used to encapsulate the NetApp Filer version string, and provide access to the components of the string as a numeric release, a perl version, and a date string. METHODS
get_release Returns the NetApp numerical release as a string, for example: 7.2.2 get_date Returns the NetApp release date as a string, for example: Sat Mar 24 20:38:59 PDT 2007 get_string Returns the unparsed version string in it's entirety: NetApp Release 7.2.2: Sat Mar 24 20:38:59 PDT 2007 get_version Returns the NetApp release as a perl version object. perl v5.14.2 2008-11-26 NetApp::Filer::Version(3pm)
All times are GMT -4. The time now is 01:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy