Sponsored Content
Top Forums Shell Programming and Scripting How to deal with long records (> 8k)?? Post 302203518 by era on Monday 9th of June 2008 04:15:25 AM
Old 06-09-2008
There is no standard maximum, although the ARG_MAX constant limits how long a command line can be. Do you get "command line too long" errors when running this script? In this particular case, you can probably simply avoid using echo altogether:

Code:
while db2 +cp -x fetch from c1
do
 : nothing
done | tr -s " "

Maybe this doesn't even have to run in a loop at all -- if you can change the db2 invocation to retrieve all lines at once, you can take out the while loop, too.
 

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Great deal!

Okay, I don't know how this is funny, but it is. I found this while searching for Linux (please don't ask). :o (0 Replies)
Discussion started by: gnerd
0 Replies

2. Shell Programming and Scripting

Count No of Records in File without counting Header and Trailer Records

I have a flat file and need to count no of records in the file less the header and the trailer record. I would appreciate any and all asistance Thanks Hadi Lalani (2 Replies)
Discussion started by: guiguy
2 Replies

3. Programming

how to deal with hardware

hi how to deal with hardware in c or c++? i need to learn how open CD and close any hard >>> and control hardware :) (2 Replies)
Discussion started by: hgphsf
2 Replies

4. Shell Programming and Scripting

Based on num of records in file1 need to check records in file2 to set some condns

Hi All, I have two files say file1 and file2. I want to check the number of records in file1 and if its atleast 2 (i.e., 2 or greater than 2 ) then I have to check records in file2 .If records in file2 is atleast 1 (i.e. if its not empty ) i have to set some conditions . Could you pls... (3 Replies)
Discussion started by: mavesum
3 Replies

5. Shell Programming and Scripting

Editing long records with characters that need to be escaped.

Hi all, I'm new in unix scripting and I've a problem with a script... :confused: I need to read a file, add some fields in the records, and write them in another file, but even when I simply read and write the records, the shell interprets some caracters and the result is that the records... (5 Replies)
Discussion started by: Macs_Linux
5 Replies

6. UNIX for Dummies Questions & Answers

Grep specific records from a file of records that are separated by an empty line

Hi everyone. I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this: ID: 20 Name: X Age: 19 ID: 21 Name: Z ID: 22 Email: xxx@yahoo.com Name: Y Age: 19 I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies

7. Shell Programming and Scripting

Compare two files with different number of records and output only the Extra records from file1

Hi Freinds , I have 2 files . File 1 |nag|HYd|1|Che |esw|Gun|2|hyd |pra|bhe|3|hyd |omu|hei|4|bnsj |uer|oeri|5|uery File 2 |nag|HYd|1|Che |esw|Gun|2|hyd |uer|oi|3|uery output : (9 Replies)
Discussion started by: i150371485
9 Replies

8. Windows & DOS: Issues & Discussions

How to copy a file with long records ,i.e spanning to 2 or 3 lines from UNIX to excel?

Hi Experts, I have a Unix csv file which has long records ie the record length is more than 80 so it goes to the next line.So when its in unix though it spans to two or three lines it still counts it as one record. But what is happening is for the records that are long when i copy it into excel i... (0 Replies)
Discussion started by: 100bees
0 Replies

9. Shell Programming and Scripting

Separate records of a file on 2 types of records

Hi I am new to shell programming in unix Please if I can provide help. I have a file structure of a header record and "N" detail records. The header record will be the total number of detail records I need to split the file in 2: One for the header Another for all detail records Could... (1 Reply)
Discussion started by: jamcogar
1 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 07:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy