Sponsored Content
Top Forums Shell Programming and Scripting To check the file and remove header before copying Post 302999251 by rohit_shinez on Friday 16th of June 2017 12:02:51 AM
Old 06-16-2017
Thanks
But yours wont work because there is no header like unique and in property file there is no header string like that i need to remove the header from source file before copying
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove header(first line) and trailer(last line) in ANY given file

Hi, I need some help in removing the header (first line) and the trailer (last line) in a give file... The data file actually comes in EBCDIC format and I converted it into ASCII.. Now I need to strip off the first line and the last line.. I think we can use sed to do something like this:... (2 Replies)
Discussion started by: madhunk
2 Replies

2. UNIX for Dummies Questions & Answers

Copy all the files with time stamp and remove header,trailer from file

All, I am new to unix and i have the following requirement. I have file(s) landing into input directory with timestamp, first i want to copy all these files into seperate directory then i want to rename these files without timestamp and also remove header,trailer from that file.. Could... (35 Replies)
Discussion started by: ksrams
35 Replies

3. Shell Programming and Scripting

Check file size and remove files

Hi, Here we have a situation where we have to check the file size and if the file size is greater than 0 bytes then remove the files from the directory. 1)EdwTrxn 2)EdwPost 3)EdwTndr 4)EdwSls 5)EdwSlsRej 6)EdwTndrRej Files will be created in the directory in the following manner. ... (5 Replies)
Discussion started by: srivsn
5 Replies

4. UNIX for Dummies Questions & Answers

Check header of file, without opening the file

if we happen to have a very big .csv file we cannot or dont care to edit, is there a way to check if the file contains a header row? (2 Replies)
Discussion started by: lydiaflamp
2 Replies

5. Shell Programming and Scripting

Copying the Header & footer Information to the Outfile.

Hi I am writing a perl script which checks for the specific column values from a file and writes to the OUT file. So the feed file has a header information and footer information. I header information isaround107 lines i.e. Starts with START-OF-FILE ....... so on .... ... (11 Replies)
Discussion started by: filter
11 Replies

6. Shell Programming and Scripting

Remove last few characters in a file but keeping Header and trailer intact

Hi All, I am trying write a simple command using AWK and SED to this but without any success. Here is what I am using: head -1 test1.txt>test2.txt|sed '1d;$d' test1.txt|awk '{print substr($0,0,(length($0)-2))}' >>test2.txt|tail -1 test1.txt>>test2.txt Input: Header 1234567 abcdefgh... (2 Replies)
Discussion started by: nvuradi
2 Replies

7. Shell Programming and Scripting

Remove the file content based on the Header of the file

Hi All, I want to remove the content based on the header information . Please find the example below. File1.txt Name|Last|First|Location|DepId|Depname|DepLoc naga|rr|tion|hyd|1|wer|opr Nava|ra|tin|gen|2|wera|opra I have to search for the DepId and remove the data from the... (5 Replies)
Discussion started by: i150371485
5 Replies

8. UNIX for Advanced & Expert Users

How to check or remove IP address from a hashed known_hosts file?which

Hi, In my server, the hostname and IP addresses are added to the known_hosts which then be hashed by ssh-keygen -H -f. Is it possible to check if an IP address has already been added to the hashed known_hosts to avoid duplications (I think there will be problems if there are duplicated IP... (3 Replies)
Discussion started by: hce
3 Replies

9. UNIX for Dummies Questions & Answers

Check for empty line at end of a dynamic header in each file

Hi Folks, I have a requirement to develop a shell script. PFB my requirement, Requirement: I need to check an empty line after the end of each header in respective file and if a empty line is present simply echo file OK and if empty line is not present echo "Adding empty line" and add an... (6 Replies)
Discussion started by: tpk
6 Replies

10. Shell Programming and Scripting

Find header in a text file and prepend it to all lines until another header is found

I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty. I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)
Discussion started by: verdepollo
3 Replies
inet6_rth_space(3N)													       inet6_rth_space(3N)

NAME
inet6_rth_add(), inet6_rth_getaddr(), inet6_rth_init(), inet6_rth_reverse(), inet6_rth_segments(), inet6_rth_space() - IPv6 Routing header options manipulation functions. SYNOPSIS
DESCRIPTION
These functions can be used by an application to build and examine an IPv6 Routing header. The Routing header can be used by an IPv6 source to list one or more intermediate nodes to be visited on the way to a packet's destination. These three functions build a Routing header: returns the number of bytes required for a Routing header. initializes the buffer data for a Routing header. adds one IPv6 address to the Routing header. Three functions deal with a returned Routing header: reverses a Routing header. returns the number of segments in a Routing header. fetches one address from a Routing header. These functions are described below: This function returns the number of bytes required to hold a routing header of the specified type containing the specified number of segments (addresses). For an IPv6 Type 0 Routing header, the number of segments must be between 0 and 127, inclusive. The return value is just the space for the Routing header. When the application uses ancillary data, it must pass the returned length to to determine how much memory is needed for the ancillary data object (includ- ing the structure). If the return value is 0, then either the type of the Routing header is not supported by this implementation or the number of segments is invalid for this type of Routing header. This function returns the size but does not allocate the space required for the ancillary data. Note: If type is 2 (Routing Header Type 2), segments must be 1 (RFC 4584). This function initializes the buffer pointed to by bp to contain a Routing header of the specified type. bp_len is only used to verify if the buffer is large enough. The caller must allocate the buffer, and its size can be determined by calling Upon success, the return value is the pointer to the buffer (bp), and the pointer is then used as the first argument to the function. Upon an error, the return value is NULL. Note: If type is 2 (Routing Header Type 2), segments must be 1 (RFC 4584). This function adds the IPv6 address pointed to by addr to the end of the Routing header being constructed. If successful, the member of the Routing header is updated to account for the new address in the Routing header and the return value of the function is 0. Upon an error the return value of the function is -1. Note: If the Routing header is type 2, this function can only be called once. This function takes a Routing header extension header pointed to by the first argument in and writes a new Routing header. The new Routing header sends datagrams along the reverse of that route. The function reverses the order of the addresses and sets the member in the new routing header to the number of segments. Both arguments are allowed to point to the same buffer (that is, the reversal can occur in place). The return value of the function is 0 on success, or -1 upon an error. Note: If Routing header is type 2, this function returns -1 (RFC 4584). This function returns the number of segments (addresses) contained in the Routing header described by bp which can be 0 or greater. The return value of the function is -1 upon an error. This function returns a pointer to the IPv6 address specified by index (which must be a value between 0 and one less than the value returned by in the Routing header described by bp. An application should first call to obtain the number of segments in the Routing header. Upon an error, the return value of the function is NULL. Note: If Routing header is type 2, this function returns a pointer to the IPv6 home address specified by the ip6r2_homeaddr field in which is pointed by bp. The index must be zero. Notes To use these functions, the application must be compiled with: To receive a Routing header, the application must enable the socket option: To send a Routing header, the application specifies it either as ancillary data in a call to or using (see send(2) and getsockopt(2), respectively). EXAMPLES
gives a comprehensive example in Appendix B. SEE ALSO
send(2), getsockopt(2), IPv6(7P), xopen_networking(7). inet6_rth_space(3N)
All times are GMT -4. The time now is 07:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy