Sponsored Content
Top Forums Shell Programming and Scripting Copy Limited rows from one file to another Post 302269173 by ravi214u on Wednesday 17th of December 2008 03:38:46 AM
Old 12-17-2008
Copy Limited rows from one file to another

Hi,

The file contains 1000 of rows can you please let me know
How to copy 1-10 and 30-40 rows from one file to another.


thanks
Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture output of program to file with limited filesize

I'm working on a script that will perform a backup, save a log of said backup and send the output to me in an email. Everything is working fine so far except that I can't figure out how to specify a maximum file size for the log file. I don't want a runaway log file jamming up the server.... (7 Replies)
Discussion started by: spectre_240sx
7 Replies

2. UNIX for Dummies Questions & Answers

MAX file size limited to 2GB

Hi All, We are running HP rp7400 box with hpux 11iv1. Recently, we changed 3 kernel parameters a) msgseg from 32560 to 32767 b) msgmnb from 65536 to 65535 c) msgssz from 128 to 256 Then we noticed that all application debug file size increase upto 2GB then it stops. So far we did not... (1 Reply)
Discussion started by: mhbd
1 Replies

3. Shell Programming and Scripting

to parse (or grep) a number from a datafile and write it to tab limited file

Hi All, I have a folder that contain 100's of subfolders namely: Main folder -> GHFG - Subfoders ->10 100 234 102 345 .. .. ... (2 Replies)
Discussion started by: Lucky Ali
2 Replies

4. UNIX for Dummies Questions & Answers

Process some limited file from a directory

Hi, I am having a directory, Having some thousand of file i want to process mean some limited files (say 6 number of files ) not the all files at a time to do that operation on them(after finish operation i'll remove and take that file back up ). Can i achieve this thing using set and shift... (2 Replies)
Discussion started by: posix
2 Replies

5. Shell Programming and Scripting

Copy and Paste Columns in a Tab-Limited Text file

I have this text file with a very large number of columns (10,000+) and I want to move the first column to the position of the six column so that the text file looks like this: Before cutting and pasting ID Family Mother Father Trait Phenotype aaa bbb ... (5 Replies)
Discussion started by: evelibertine
5 Replies

6. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

7. Shell Programming and Scripting

How to copy or cut specific rows from appended file with some conditions

Hi I have one file which is containing about 5000 rows and 20 columns I will just explain about my requirement here briefly with sample file, I have attached also, please help....me.. 1 28.25 36.42 5 28.26 36.42 10 28.23 36.43 15 28.22 36.43 20 28.2 36.42 25... (6 Replies)
Discussion started by: nex_asp
6 Replies

8. UNIX for Dummies Questions & Answers

Awk: how to copy a range of rows in GAMS environment

Hi I have a problem in using awk in GAMS. I have to copy a part of a .txt file selecting the rows between these two lines "0 / END OF TRANSFORMER DATA, BEGIN AREA DATA" "0 / END OF AREA DATA, BEGIN TWO-TERMINAL DC DATA" I thought of using a command like this: $onecho > area.awk... (4 Replies)
Discussion started by: Pintug
4 Replies

9. Shell Programming and Scripting

Moving or copying first rows and last rows into another file

Hi I would like to move the first 1000 rows of my file into an output file and then move the last 1000 rows into another output file. Any help would be great Thanks (6 Replies)
Discussion started by: kylle345
6 Replies

10. Shell Programming and Scripting

(hard one) awk, copy matching 2 col & 10-12 rows, is it possible?

Hey guys, my first post here. I'm trying to use awk to copy all matching paragraphs from one file The file looks like this : Test Case Number 990990003099 Card Type CCCC Transaction Type Sale Entry Mode Keyed Account Number 4099562299219923 Transaction Amount 78.88 Description lorem... (2 Replies)
Discussion started by: awkawed
2 Replies
PG_COPY_FROM(3) 														   PG_COPY_FROM(3)

pg_copy_from - Insert records into a table from an array

SYNOPSIS
bool pg_copy_from (resource $connection, string $table_name, array $rows, [string $delimiter], [string $null_as]) DESCRIPTION
pg_copy_from(3) inserts records into a table from $rows. It issues a COPY FROM SQL command internally to insert records. PARAMETERS
o $connection - PostgreSQL database connection resource. o $table_name - Name of the table into which to copy the $rows. o $rows - An array of data to be copied into $table_name. Each value in $rows becomes a row in $table_name. Each value in $rows should be a delimited string of the values to insert into each field. Values should be linefeed terminated. o $delimiter - The token that separates values for each field in each element of $rows. Default is TAB. o $null_as - How SQL NULL values are represented in the $rows. Default is N ("\N"). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pg_copy_from(3) example <?php $db = pg_connect("dbname=publisher") or die("Could not connect"); $rows = pg_copy_to($db, $table_name); pg_query($db, "DELETE FROM $table_name"); pg_copy_from($db, $table_name, $rows); ?> SEE ALSO
pg_copy_to(3). PHP Documentation Group PG_COPY_FROM(3)
All times are GMT -4. The time now is 05:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy