03-09-2005
perl -pi -e 'print "header\n" if $.==1' file1
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i need help..!!!!
i have one big text file estimate data file size 50 - 100GB with 70 Mega Rows.
on OS SUN Solaris version 8
How i can remove first line of the text file.
Please suggest me for solutions.
Thank you very much in advance:) (5 Replies)
Discussion started by: madoatz
5 Replies
2. Shell Programming and Scripting
I have file which contains around 5000 lines.
The lines are fixed legth but having no delimiter.Each line line contains nearly 3000 characters.
I want to delete the lines
a> if it starts with 1 and if 576th postion is a digit i,e 0-9
or
b> if it starts with 0 or 9(i,e header and footer)
... (4 Replies)
Discussion started by: millan
4 Replies
3. Shell Programming and Scripting
Hi Experts,
I had to edit (a particular value) in header line of a very huge file so for that i wanted to search & replace a particular value on a file which was of 24 GB in Size. I managed to do it but it took long time to complete. Can anyone please tell me how can we do it in a optimised... (7 Replies)
Discussion started by: manishkomar007
7 Replies
4. Shell Programming and Scripting
Hi,
I need to insert a new line containing the string "QUERY" above every 5 lines.
The below piece of code inserts a new line after every 5th line
awk '{print $0} !(NR%5) {print "QUERY"}'
sed 'n;n;n;n;G;' --> I do not know how to give "QUERY" string here
But I need to insert it before... (4 Replies)
Discussion started by: royalibrahim
4 Replies
5. Shell Programming and Scripting
We have a huge file which has just one really large line; about 500 MB. I want to
1. Count all the occurrences of a phrase
2. Replace the phrase with another.
Trying to open it using vi has not helped as it complains that it is too large. Can any script help? Please advise.
Thank you, (12 Replies)
Discussion started by: kaushikadya
12 Replies
6. Shell Programming and Scripting
Hi all,
I have a huge file(size more that 5GB).
I want to do some manupulation with the records and write to another file.
As the size of the file is huge and there is a space constraint in that directory, I want to delete that record from first file after writing it in to second file.... (3 Replies)
Discussion started by: gani_85
3 Replies
7. Shell Programming and Scripting
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
Discussion started by: JolietJake
2 Replies
8. UNIX for Dummies Questions & Answers
Hi ,
I would like to replace new line characters(\n) in a huge file of about 2 million records . I tried this one (:%s/\n//g) but it's hanging there and no result. Does this command do not work if the file is big. Please let me know if you have any other options
Regards
Raj (1 Reply)
Discussion started by: rajeevm
1 Replies
9. UNIX for Beginners Questions & Answers
Hi All,
I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise
My intention is to insert a line of text after 13th line of every file inside a particular directory.
While trying to do it for a single file , i am using sed
sed '3 i this is the 4th line' filename
sed: command garbled: 3... (5 Replies)
Discussion started by: gotamp
5 Replies
10. Shell Programming and Scripting
Hi.
Pardon me if I'm posting a duplicate thread but..
I have a text file with over 150 Million records, file size is in the range if MB(close to GB).
The requirement is to read ALL the lines excepting the FIRST LINE which is the file header and the LAST LINE which is it's trailer record.
... (8 Replies)
Discussion started by: kumarjt
8 Replies
LEARN ABOUT OSF1
curs_deleteln
curs_deleteln(3) Library Functions Manual curs_deleteln(3)
NAME
curs_deleteln, deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln - Delete or insert lines in a Curses window
SYNOPSIS
#include <curses.h>
int deleteln(
void ); int wdeleteln(
WINDOW *win ); int insdelln(
int n ); int winsdelln(
WINDOW *win,
int n ); int insertln(
void ); int winsertln(
WINDOW *win );
LIBRARY
Curses Library (libcurses)
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln: XCURSES4.2
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
The deleteln and wdeleteln routines do the following: Delete the line under the cursor in the current or specified window Move all lines
below the current line up one line Clear the bottom line of the window
These routines do not change the cursor position. (This does not imply use of a hardware delete line feature.)
The insdelln and winsdelln routines do the following: For positive n, insert n lines into the current or specified window above the current
line
The n bottom lines are lost. For negative n, delete n lines (starting with the one under the cursor), and move the remaining lines
up
The bottom n lines are cleared.
These routines do not change the current cursor position.
The insertln and insertln routines insert a blank line above the current line. The bottom line is lost. (This does not imply use of a hard-
ware insert line feature.)
NOTES
The header file <curses.h> automatically includes the header file <stdio.h>.
Note that all routines except winsdelln may be macros.
RETURN VALUES
All routines return ERR upon failure and OK upon successful completion.
SEE ALSO
Functions: curses(3)
Others: standards(5)
curs_deleteln(3)