Thank you very much! head -n100000 works like a charm.
---------- Post updated at 03:06 PM ---------- Previous update was at 09:13 AM ----------
ok new problem
i decided that i would like to preform an action between the lines 100k and 200k (for example). The easy way i tried out
did not worked and i'm guessing that tail reads the whole file first so that will be a bad idea (the file is really big). Next thing i'm thinking is using sed
something like
but it's kinda slow when the grep is added. Any help would be greatly appricieted
hi gurus
i'm trying to get the count of number of records of a file
as : wc -l file1.txt
iam getting the correct count by in out put i'm getting the file name too
i get the output as follows "7 file1.txt"
my question is how to avoid filename in the output.
might be a basic... (20 Replies)
Hi,
Is it possible to find the total number of records processed by awk at begining.
NR gives the value at the end. Is there any variable available to find the value at the begining?
Thanks
----------
Suman (1 Reply)
Hai
I have a flat file which contains more than 6 crore lines or records. I want to delete only one line, using line number. For example I want to delete 414556 th line . How to do this using sed or awk command.
thanks (3 Replies)
Initially i store some files into anothe file Y. Now i want read the contents of file Y one by one do some check on each file.
i,e
Open file Y (contains multiple files)
First read a file , do some check on that individual file.If that file satisfies teh condition put it in another file.
Now... (1 Reply)
Hi,
I have CSV file which looks like below, i want to calulate number of records for each brand say SOLO_UNBEATABLE E and SOLO_UNBEATABLE F combined and record count is say 20 . i want to calculate for each brand, and here only first record will have all data and rest of record for the brand... (2 Replies)
Hi All,
I want to find the number of records in a file of a particular directory
I have a file as abcd.txt in the path
var/hr/payments/
I want to find number of records in abcd.txt file in a single command.
I tried the following
cd /var/hr/payments/wc -l abcd.txt
I got... (5 Replies)
I am doing a loading process. I am loading data from a Oracle source to Oracle target.
For example there is an SQL statement:
Insert into emp_1
Select * from emp_2 where deptno=20;
In this case my source is emp_2 and loading into my target table emp_1. This process is automated. Now I... (3 Replies)
I would like to print the number of records of 2 files, and divide the two numbers
awk '{print NR}' file1 > output1
awk '{print NR}' file2 > output2
paste output1 output2 > output
awl '{print $1/$2}' output > output_2
is there a faster way? (8 Replies)
How does one assign a variable, x to equal the number of records in a different file.
I have a simple command such as below:
awk -F "\t" '(NR>5) { if(($x == "0/0")) { print $0} }' a.txt > a1.txt
but I want x to equal the number of records in a different file, b.txt (10 Replies)
Discussion started by: Geneanalyst
10 Replies
LEARN ABOUT OSF1
head
head(1) General Commands Manual head(1)NAME
head - Displays the beginning of files
SYNOPSIS
Current Syntax
head [-c bytes] [-n lines] [file...]
Obsolescent Syntax
head [-lines] [file...]
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
head: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
The default count is 10. [Tru64 UNIX] Specifies the number of bytes to display. If the last byte written is not a newline character, a
newline character is appended to the output. Specifies the number of lines to display Works exactly as -n lines. Obsolescent.
OPERANDS
Path name of the input file. If you do not specify a file, head reads standard input.
DESCRIPTION
The head command copies the standard input to standard output, ending output of each file at the specified point.
NOTES
The obsolescent form is subject to withdrawal at any time.
EXIT STATUS
The following exit values are returned: Successful completion. An error occurred.
EXAMPLES
To display the first 5 lines of a file called test, enter: head -n 5 test To display the first ten lines of all files (except those with a
name beginning with a period), enter: head *
ENVIRONMENT VARIABLES
The following environment variables affect the execution of head: Provides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value,
overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as opposed to multibyte characters in arguments and input files). Determines the
locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the
processing of LC_MESSAGES.
SEE ALSO
Commands: cat(1), more(1), pg(1), sed(1), tail(1)
Standards: standards(5)head(1)