06-28-2013
That’s just wonderful. I knew I am being very amateur in that coding.
One last help on “Message body” I want my message body content same as input file (in this case “input”)
Thanks lot.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to remove lines of data that contain duplicate data in a specific column.
For example.
apple 12345
apple 54321
apple 14234
orange 55656
orange 88989
orange 99898
I only want to see
apple 12345
orange 55656
How would i go about doing this? (5 Replies)
Discussion started by: spartan22
5 Replies
2. Shell Programming and Scripting
I am a newbie to shell scripting ..
I have a .csv file. It has 1000 some rows and about 7 columns...
but before I insert this data to a table I have to parse it and clean it ..basing on the value of the first column..which a string of phone number type...
example below..
column 1 ... (2 Replies)
Discussion started by: mitr
2 Replies
3. Shell Programming and Scripting
Hello everybody,
I'm trying to count the number of consecutive lines in a text file which have two distinctive column field values. These lines may appear in several line blocks within the file, but I only want a single block to be counted.
This was my first approach to tackle the problem (I'm... (6 Replies)
Discussion started by: origamisven
6 Replies
4. Shell Programming and Scripting
Need to transpose every 2 fields of a row into a single 2 field column.
input
4 135 114 76 217 30 346 110
5 185 115 45 218 85 347 125
6 85 116 130 220 65 352 95
11 30 117 55 221 42 355 75
16 72 118 55 224 37 357 430
17 30 119 55 225 40 358 62
21 52 120 65 232 480 360 180
....... (8 Replies)
Discussion started by: sdf
8 Replies
5. UNIX for Dummies Questions & Answers
Hi experts, I have a tab-delimited file with one column containing values separated by a comma. I wish to duplicate the entire line for every value in that comma-delimited field.
For example:
$cat file
4444 4444 4444 4444
9990 2222,7777 6666 2222 ... (3 Replies)
Discussion started by: torchij
3 Replies
6. Shell Programming and Scripting
Hi,
I have a similar input format-
A_1 2
B_0 4
A_1 1
B_2 5
A_4 1
and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks!
letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies
7. Shell Programming and Scripting
Hi all,
I am new to using awk and am quickly discovering what a powerful pattern-recognition tool it is. However, I have what seems like a fairly basic task that I just can't figure out how to perform in one line. I want awk to find and print all the lines in which one of multiple patterns (e.g.... (8 Replies)
Discussion started by: elgo4
8 Replies
8. UNIX for Dummies Questions & Answers
Hi would like to ask you guys any advise regarding my problem
I have this kind of data
file.txt
111111111,20
111111111,50
222222222,70
333333333,40
444444444,10
444444444,20
I need to get this
file1.txt
111111111,70
222222222,70
333333333,40
444444444,30
using this code I can... (6 Replies)
Discussion started by: reks
6 Replies
9. Shell Programming and Scripting
Hi Experts,
Please bear with me, i need help
I am learning AWk and stuck up in one issue.
First point : I want to sum up column value for column 7, 9, 11,13 and column15 if rows in column 5 are duplicates.No action to be taken for rows where value in column 5 is unique.
Second point : For... (12 Replies)
Discussion started by: as7951
12 Replies
10. UNIX for Beginners Questions & Answers
I have a file abc.csv, from which I need column 24(PurchaseOrder_TotalCost) to get the sum_of_amounts with date and row count into another file say output.csv
abc.csv-
UTF-8,,,,,,,,,,,,,,,,,,,,,,,,,
... (6 Replies)
Discussion started by: Tahir_M
6 Replies
LEARN ABOUT CENTOS
dblink_build_sql_update
DBLINK_BUILD_SQL_UPDATE(3) PostgreSQL 9.2.7 Documentation DBLINK_BUILD_SQL_UPDATE(3)
NAME
dblink_build_sql_update - builds an UPDATE statement using a local tuple, replacing the primary key field values with alternative supplied
values
SYNOPSIS
dblink_build_sql_update(text relname,
int2vector primary_key_attnums,
integer num_primary_key_atts,
text[] src_pk_att_vals_array,
text[] tgt_pk_att_vals_array) returns text
DESCRIPTION
dblink_build_sql_update can be useful in doing selective replication of a local table to a remote database. It selects a row from the local
table based on primary key, and then builds a SQL UPDATE command that will duplicate that row, but with the primary key values replaced by
the values in the last argument. (To make an exact copy of the row, just specify the same values for the last two arguments.) The UPDATE
command always assigns all fields of the row -- the main difference between this and dblink_build_sql_insert is that it's assumed that the
target row already exists in the remote table.
ARGUMENTS
relname
Name of a local relation, for example foo or myschema.mytab. Include double quotes if the name is mixed-case or contains special
characters, for example "FooBar"; without quotes, the string will be folded to lower case.
primary_key_attnums
Attribute numbers (1-based) of the primary key fields, for example 1 2.
num_primary_key_atts
The number of primary key fields.
src_pk_att_vals_array
Values of the primary key fields to be used to look up the local tuple. Each field is represented in text form. An error is thrown if
there is no local row with these primary key values.
tgt_pk_att_vals_array
Values of the primary key fields to be placed in the resulting UPDATE command. Each field is represented in text form.
RETURN VALUE
Returns the requested SQL statement as text.
NOTES
As of PostgreSQL 9.0, the attribute numbers in primary_key_attnums are interpreted as logical column numbers, corresponding to the column's
position in SELECT * FROM relname. Previous versions interpreted the numbers as physical column positions. There is a difference if any
column(s) to the left of the indicated column have been dropped during the lifetime of the table.
EXAMPLES
SELECT dblink_build_sql_update('foo', '1 2', 2, '{"1", "a"}', '{"1", "b"}');
dblink_build_sql_update
-------------------------------------------------------------
UPDATE foo SET f1='1',f2='b',f3='1' WHERE f1='1' AND f2='b'
(1 row)
PostgreSQL 9.2.7 2014-02-17 DBLINK_BUILD_SQL_UPDATE(3)