05-07-2012
Perfect Pokerino..
Thank you very much for your help...
Thanks,
Susi.S
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hello,
I need to insert a line (like a header) as the first line of a very huge file (about 3 ml rows). I am able to do it with sed, but redirecting the output and creating a new file takes quite some time. I was wondering if there was a more efficient way of doing it?
Any help would be... (3 Replies)
Discussion started by: shriek
3 Replies
2. Shell Programming and Scripting
Can I insert rows based on line numbers. Say If I need to insert 1 or more rows in a file from line number 10. Can I do that in UNIX
I have a file something like
A
B
C
D
E
F
After row C, I wanted to add 2 records as X and Y. I have the line number after C as my reference. Can I... (2 Replies)
Discussion started by: Muthuraj K
2 Replies
3. Shell Programming and Scripting
Hi,
I have a file which has a number in each line ( i think they are strings )
I will have a $first and $last variable, which are strings but contains only numbers. Also a file $f, I want to filter out the lines in $f with only numbers in between $first and $last. Do I need to consider the... (2 Replies)
Discussion started by: a27wang
2 Replies
4. Shell Programming and Scripting
I have a file, in which a single record spans across multiple lines,
File 1
====
14|\n
leave request \n
accepted|Yes|
15|\n
leave request not \n
acccepted|No|
I wanted to remove the '\n charecters. I used the below code (foudn somewhere in this forum)
perl -e 'while (<>) { if... (1 Reply)
Discussion started by: machomaddy
1 Replies
5. 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
6. Shell Programming and Scripting
Hi
I had the text file as below and i wand to keep only 4 lines from tag :7023: to next : (i.e new tag start) including tag lines. any solution ?
:7023:TEST LINE NUMBER
1101010021442 TESTING
HI HERE
PLEASE HELP ME OUT
AC 20101906523
:7028:OUR (12 Replies)
Discussion started by: sandipgawale
12 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 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
9. Shell Programming and Scripting
I have a file contains thousands of lines. I want to insert n random numbers into each line at
specific position. Like this:
0 22……
1 33……
……
……
I want to insert 3 random numbers from position 2 to 4 into each line.
0 325 22……
1 685 33……
……
……
Please use CODE tags when... (8 Replies)
Discussion started by: hhdzhu
8 Replies