Hello,
I am building an .xls file extracting info from a DB to be eventually emailed. All is good except how do I put in a header row.. like date, name of report etc. before the columns with the actual column name and data?
Thanks for any assistance.. the below is after I have signed into... (11 Replies)
So, I have a massive file with thousands of columns
I want a list of the headers in one column in another file.
So I need to strip off the top line (can use head-1)
But how can I convert from this format:
A B C D E F G
to
A
B
C
D
E
F
G (6 Replies)
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)
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)
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)
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)
Hi All,
i have script like ...
"TYPE_ID" "ID" "LIST_ID"
"18" "52010" "1059"
"18" "52010" "1059"
"18" "52010" "1059"
"18" "52010" "1059"
i am using the below code it's not taking the header row.
awk -F"\t" -v file=test1.txt -v file1=test2.txt ' {
if(... (7 Replies)
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)
I am just trying to insert the word "Index" using awk. The below is close but seems to add the word at the end and I can not get the syntax correct to add from the beginning. Thank you :).
awk -F'\t' -v OFS='\t' '{ $-1=$-1 OFS "Index"}$1=$1' file
current output
Chr Start End ... (3 Replies)
The awk below does put in VUS in the 9th field but I can not seem to skip the header then add the VUS. I tried to incorporate NR >=2 and NR > 1 with no luck. Thank you :).
input
Chr Start End Ref Alt Func.refGene PopFreqMax CLINSIG Classification
chr1 43395635 ... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT DEBIAN
net::ipv4addr
IPv4Addr(3pm) User Contributed Perl Documentation IPv4Addr(3pm)NAME
Net::IPv4Addr - Perl extension for manipulating IPv4 addresses.
SYNOPSIS
use Net::IPv4Addr qw( :all );
my ($ip,$cidr) = ipv4_parse( "127.0.0.1/24" );
my ($ip,$cidr) = ipv4_parse( "192.168.100.10 / 255.255.255.0" );
my ($net,$msk) = ipv4_network( "192.168.100.30" );
my $broadcast = ipv4_broadcast( "192.168.100.30/26" );
if ( ipv4_in_network( "192.168.100.0", $her_ip ) ) {
print "Welcome !";
}
etc.
DESCRIPTION
Net::IPv4Addr provides functions for parsing IPv4 addresses both in traditional address/netmask format and in the new CIDR format. There
are also methods for calculating the network and broadcast address and also to check if a given address is in a specific network.
ADDRESSES
All of Net::IPv4Addr functions accept addresses in many formats. The parsing is very liberal.
All these addresses would be accepted:
127.0.0.1
192.168.001.010/24
192.168.10.10/255.255.255.0
192.168.30.10 / 21
10.0.0.0 / 255.0.0.0
255.255.0.0
Those wouldn't though:
272.135.234.0
192.168/16
Most functions accepts the address and netmask or masklength in the same scalar value or as separate values. That is either
my($ip,$masklength) = ipv4_parse($cidr_str);
my($ip,$masklength) = ipv4_parse($ip_str,$msk_str);
USING
No functions are exported by default. Either use the ":all" tag to import them all or explicitly import those you need.
FUNCTIONS
ipv4_parse
my ($ip,$msklen) = ipv4_parse($cidr_str);
my $cidr = ipv4_parse($ip_str,$msk_str);
my ($ip) = ipv4_parse($ip_str,$msk_str);
Parse an IPv4 address and return in scalar context the address in CIDR format, in an array context the address and the mask length.
If the parameters doesn't contains a netmask or a mask length, in scalar context only the IPv4 address is returned and in an array
context the mask length is undefined.
If the function cannot parse its input, it croaks. Trap it using "eval" if you don't like that.
ipv4_broadcast
my ($broadcast) = ipv4_broadcast($ip_str);
my $broadcast = ipv4_broadcast($ip_str,$msk_str);
This function returns the broadcast address. If the input doesn't contain a netmask or mask length, the default netmask is assumed.
This function croaks if the input is invalid.
ipv4_network
my $cidr = ipv4_network($ip_str);
my $cidr = ipv4_network($cidr_str);
my ($net,$msk) = ipv4_network( $net_str, $msk_str);
In scalar context, this function returns the network in CIDR format in which the address is. In array context, it returns the network
address and its mask length as a two elements array. If the input is a host without a netmask or mask length, the default netmask is
assumed.
Again, the function croaks if the input is invalid.
ipv4_in_network
print "Yes" if ipv4_in_network( $cidr_str1, $cidr_str2);
print "Yes" if ipv4_in_network( $ip_str1, $mask_str1, $cidr_str2 );
print "Yes" if ipv4_in_network( $ip1, $mask1, $ip2, $msk2 );
This function checks if the second network is contained in the first one and it implements the following semantics :
If net1 or net2 is a magic address (0.0.0.0 or 255.255.255.255)
then this function returns true.
If net1 is a host, net2 will be in the same net only if
it is the same host.
If net2 is a host, it will be contained in net1 only if
it is part of net1.
net2 is only part of net1 if it is entirely contained in
net1.
Trap bad input with "eval" or else.
ipv4_chkip
if ($ip = ipv4_chkip($str) ) {
# Do something
}
Return the IPv4 address in the string or undef if the input doesn't contain a valid IPv4 address.
ipv4_cidr2msk
my $netmask = ipv4_cidr2msk( $cidr );
Returns the netmask corresponding to the mask length given in the input. As usual, croaks if it doesn't like your input (in this case
a number between 0 and 32).
ipv4_msk2cidr
my $masklen = ipv4_msk2cidr( $msk );
Returns the mask length of the netmask in the input. As usual, croaks if it doesn't like your input.
AUTHOR
Francis J. Lacoste <francis.lacoste@iNsu.COM>
COPYRIGHT
Copyright (c) 1999, 2000 iNsu Innovations Inc. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms as perl itself.
SEE ALSO perl(1)ipv4calc(1).
perl v5.10.1 2010-07-26 IPv4Addr(3pm)