Sponsored Content
Top Forums Shell Programming and Scripting Exclude the header row while splitting the file Post 302833993 by bmk on Thursday 18th of July 2013 07:39:01 AM
Old 07-18-2013
Thanks,if we use below data test1.txt with header created. but test2.txt only creating the header without data this one i don't want because there no data for this one.

Code:
 "TYPE_ID"       "ID"    "LIST_ID"
"18"    "52010" "1010"
"18"    "52010" "1010"
"18"    "52010" "1010"
"18"    "52010" "1010"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to exclude the header in shell script using awk

Hello Everyone In my shell script, I am retrieving the cluster ID and node number of an LPAR using the following command - lsclcfg -l This command's output looks as follows - CLUSTER_NAME CLUSTER_ID NODE_NR sch1h004 6104567 3 I want to store only the... (3 Replies)
Discussion started by: gates1580
3 Replies

2. UNIX for Dummies Questions & Answers

Merge all csv files in one folder considering only 1 header row and ignoring header of all others

Friends, I need help with the following in UNIX. Merge all csv files in one folder considering only 1 header row and ignoring header of all other files. FYI - All files are in same format and contains same headers. Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies

3. Shell Programming and Scripting

Adding header to sub files after splitting the main file using AWK

Hi Folks, I have a file like: mainfile.txt: ------------- file1 abc def xyz file1 aaa pqr xyz file2 lmn ghi xyz file2 bbb tuv xyz I need output having two files file1 and file2. file1: ------ Name State Country abc def xyz aaa pqr xyz file2: (3 Replies)
Discussion started by: tanmay.gemini
3 Replies

4. UNIX for Dummies Questions & Answers

append column and row header to a file in awk script.

Hi! Is there a way to append column and row header to a file in awk script. For example if I have Jane F 39 manager Carlos M 40 system administrator Sam F 20 programmer and I want it to be # name gend age occup 1 Jane F 39 manager 2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies

5. Shell Programming and Scripting

Exclude the header row in the file to validate

Hi All, File contains header row.. we need to exclude the header row...no need to validate the first row in the file. Data in the file should take valid data(two columns)..we need to exclude the more than two columns in the file except the first line. email|firstname a|123|100 b|345... (4 Replies)
Discussion started by: bmk
4 Replies

6. Shell Programming and Scripting

Test command:Duplicate Header row in Log File

I have a script that is inventorying (not sure if thats a word) my environment. It goes out and pulls Hostname OS, IP, and ENV (dev, prod, etc)..then spits all that to a logfile At the top of my script i have a check to see if the logfile exist. ] || touch $LOGFILE && echo "ENV" "\t"... (3 Replies)
Discussion started by: nitrobass24
3 Replies

7. Shell Programming and Scripting

Add column header and row header

Hi, I have an input like this 1 2 3 4 2 3 4 5 4 5 6 7 I would like to count the no. of columns and print a header with a prefix "Col". I would also like to count the no. of rows and print as first column with each line number with a prefix "Row" So, my output would be ... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

8. 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

9. Shell Programming and Scripting

How to display the header of a matched row in a file?

Hi, So I am trying to print the first row(header) first column alongwith the matched value. But I am not sure how do I print the same, by matching a pattern located in the file eg File contents Name Place Jim NY Jill NJ Cathy CA Sam TX Daniel FL And what I want is... (2 Replies)
Discussion started by: sidnow
2 Replies

10. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies
Test::Synopsis(3pm)					User Contributed Perl Documentation				       Test::Synopsis(3pm)

NAME
Test::Synopsis - Test your SYNOPSIS code SYNOPSIS
# xt/synopsis.t (with Module::Install::AuthorTests) use Test::Synopsis; all_synopsis_ok(); # Or, run safe without Test::Synopsis use Test::More; eval "use Test::Synopsis"; plan skip_all => "Test::Synopsis required for testing" if $@; all_synopsis_ok(); DESCRIPTION
Test::Synopsis is an (author) test module to find .pm or .pod files under your lib directory and then make sure the example snippet code in your SYNOPSIS section passes the perl compile check. Note that this module only checks the perl syntax (by wrapping the code with "sub") and doesn't actually run the code. Suppose you have the following POD in your module. =head1 NAME Awesome::Template - My awesome template =head1 SYNOPSIS use Awesome::Template; my $template = Awesome::Template->new; $tempalte->render("template.at"); =head1 DESCRIPTION An user of your module would try copy-paste this synopsis code and find that this code doesn't compile because there's a typo in your variable name $tempalte. Test::Synopsis will catch that error before you ship it. VARIABLE DECLARATIONS
Sometimes you might want to put some undeclared variables in your synopsis, like: =head1 SYNOPSIS use Data::Dumper::Names; print Dumper($scalar, @array, \%hash); This assumes these variables like $scalar are defined elsewhere in module user's code, but Test::Synopsis, by default, will complain that these variables are not declared: Global symbol "$scalar" requires explicit package name at ... In this case, you can add the following POD sequence elsewhere in your POD: =for test_synopsis no strict 'vars' Or more explicitly, =for test_synopsis my($scalar, @array, %hash); Test::Synopsis will find these "=for" blocks and these statements are prepended before your SYNOPSIS code when being evaluated, so those variable name errors will go away, without adding unnecessary bits in SYNOPSIS which might confuse users. AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net> Goro Fuji blogged about the original idea at <http://d.hatena.ne.jp/gfx/20090224/1235449381> based on the testing code taken from Test::Weaken. LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Test::Pod, Test::UseAllModules, Test::Inline, Test::Snippet perl v5.10.1 2009-07-06 Test::Synopsis(3pm)
All times are GMT -4. The time now is 07:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy