Page Break in large file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Page Break in large file
# 1  
Old 11-23-2011
Page Break in large file

Hi,

The shell script inserting the millions of rows into target flat file system and handling the line number for each line.

We need a page break line after every 10,000 lines.

is there any command to insert a page break line into target file.
# 2  
Old 11-23-2011
What do you mean by a page break?... How is your script inserting lines?...

--ahamed
# 3  
Old 11-23-2011
Quote:
Originally Posted by koti_rama
Hi,

The shell script inserting the millions of rows into target flat file system and handling the line number for each line.

We need a page break line after every 10,000 lines.

is there any command to insert a page break line into target file.
Try:
Code:
awk '!(NR%10000){$0=$0 RS}1' file > newfile

Or maybe:
Code:
awk '!(NR%10000){$0=$0 "\0C"}1' file > newfile


Last edited by Franklin52; 11-23-2011 at 09:20 AM..
# 4  
Old 11-28-2011
Thanks to All
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Loading Animation for Large Man Page Repositories

Should have done this 10 years ago, so better late than never: Just added a "loading" animation to the the man page repositories when they load, especially since some are very large and take many seconds to load. See for example: https://www.unix.com/man-page-opensolaris-repository.php ... (1 Reply)
Discussion started by: Neo
1 Replies

2. Shell Programming and Scripting

Break a large file

Hi Friends, I have the following file and I would like to split it after every line that starts with done The file is like this cat script #!/bin/bash # # Name: name # Task: name # #$ -N name #$ -S /bin/bash #$ -m be #$ -M xxx #$ -e xxx #$ -o xxx (3 Replies)
Discussion started by: jacobs.smith
3 Replies

3. Shell Programming and Scripting

remove large portion of web page code between two tags

Hi everybody, I am trying to remove bunch of lines from web pages between two tags: one is <h1> and the other is <table it looks like <h1>Anniversary cards roses</h1> many lines here <table summary="Free anniversary greeting cards." cellspacing="8" cellpadding="8" width="70%">my goal... (5 Replies)
Discussion started by: georgi58
5 Replies

4. Shell Programming and Scripting

Page Break in a file for printing

Hi, We have 1lac records in source file and unix script will genarate around 1000 files. From target location the files are taking for printing on physical papers. the page size limitation : 256 Lines Can you please tell me how to insert the page break in a flat file for printer. (5 Replies)
Discussion started by: koti_rama
5 Replies

5. UNIX for Dummies Questions & Answers

Insert a break page after certain string using SED

Hi: I have 2 files: teststring.txt and a tempfile.txt teststring file contains: s/Primary Ins./\n1/g I'm trying to search for "Primary Ins." string in tempfile. For every "Primary Ins." string that is found, a new line is inserted and put in number 1. Then, write out the newfile... (7 Replies)
Discussion started by: newbeee
7 Replies

6. Shell Programming and Scripting

Perl break a file

I am trying to break a large file into smaller ones, with the break defined by the character "*". The following is the code I have so far which breaks the input file on every line instead of at the "*" character. Input file: 1 2 3 4 *5 6 7 8 9 Code: #!/usr/bin/perl... (2 Replies)
Discussion started by: cold_Que
2 Replies

7. AIX

amount of memory allocated to large page

We just set up a system to use large pages. I want to know if there is a command to see how much of the memory is being used for large pages. For example if we have a system with 8GB of RAm assigned and it has been set to use 4GB for large pages is there a command to show that 4GB of the *GB is... (1 Reply)
Discussion started by: daveisme
1 Replies

8. Shell Programming and Scripting

help on page break

Hi, i have a file say samp.s which has 123 a b c d 123 e f g h 123 i j k l 123 m n o p 234 a b c d 234 e f g h 234 i j k l the first 3 characters in each line are considered the key values i have one more file temp.txt which has 123 234 i want to have a page break in... (5 Replies)
Discussion started by: Sheema
5 Replies

9. Solaris

Page cache too large

I have a solaris10 box running a java application on it. Whenever the java app is used heavily, the amount of free memory decreases fairly rapidly. I believe I have eliminated the running applications from the culprit list. In the process I have found that the page cache is consuming about 20G... (4 Replies)
Discussion started by: timothy.edwards
4 Replies

10. Shell Programming and Scripting

Page Break with AWK or SED

Hello All, I am new to unix scripting, I have an urgent issue Is it possible to do a group by on the last column and then a page break on the text file. For example I have a text file, below is the example data STRT 2154081~VA ~23606 ~TM14~8506~1485 STRT 2130893~VA ~23602 ~TM15~8602~1586... (4 Replies)
Discussion started by: udaybo
4 Replies
Login or Register to Ask a Question