Sponsored Content
Top Forums Shell Programming and Scripting insert one line inbetween file with use of numbers Post 302636153 by pokerino on Monday 7th of May 2012 05:48:08 AM
Old 05-07-2012
Hi,

try with:
Code:
cat test.txt|sed ' /5005/ a\whateveryouwant'

 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Insert a line as the first line into a very huge file

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

Insert rows based on line numbers

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

awk filter numbers inbetween

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

How to Remove the new line character inbetween a record

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

Insert a new line before every 5th line in a file

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

Delete last two line inbetween pattern

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

How to read a text file line by line and insert into a database table?

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

Insert a line of text on nth line of a file

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

How to insert random numbers into each line?

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
update-cracklib(8)					      System Manager's Manual						update-cracklib(8)

NAME
update-cracklib - Regenerate cracklib dictionary SYNOPSIS
update-cracklib DESCRIPTION
update-cracklib builds a compressed and accumulated version of wordlists stored in the directories given in cracklib's configuration file /etc/cracklib/cracklib.conf. Programs using cracklib2 need this database to be of any use. By default this script is called by cron every day. RESULT
update-cracklib prints out two numbers: the number of words read from the ASCII dictionaries and the number of words eventually written into the cracklib database; if no error occurred, these should be equal. 0 is returned on success, otherwise an error message is printed to standard error and -1 is returned. FILES
/etc/cracklib/cracklib.conf shell script that sets cracklib_dictpath_src which must be a space separated list of source dictionary files. SEE ALSO
cracklib(3), crack_mkdict(8) AUTHOR
This program and manual page was written by Martin Pitt <martin@piware.de> for the Debian GNU/Linux System (but may be used by others). Martin Pitt June 09, 2003 update-cracklib(8)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy