Hi Guys,
I have text file containing multiple rows and multiple columns. I wrote a script which gets the sum of every row like:
which looks like
1 0 3 4
2 9 8 2
Now I want the square of every element in that text file. I know this looks like a homework but it is not. I would prefer c shell but I bash would also do since I am slowly migrating to bash.
well i have this xml file here: this file is called filereader.xml
<?xml version="1.0" encoding="UTF-8"?>
<file>
<file1>
<filecopy>thefile.txt</filecopy>
<filecopy>thefile2.ppt</filecopy>
</file1>
</file>
hi..i got this problem....hmm how do i write a... (6 Replies)
well i have this xml file here: this file is called filereader.xml
<?xml version="1.0" encoding="UTF-8"?>
<file>
<file1>
<filecopy>/new/test/thefile.txt</filecopy>
<filecopy>/new/test/thefile2.ppt</filecopy>
</file1>
</file>
i need to write the script that search for the Bold text... (2 Replies)
hi guys,
i'm writing a script that looks for a unquie id in a file and replaces a string between two square brackets on the same line as the unquie id:
.......
.......
0001 zz 43242 replace this text] name
0002 sd 65466 UK] country
.......
.......
how can i find line with id 0001... (6 Replies)
Hi All,
I have a text file which looks like this:
computer programming
systems engineering
I want to get rid of these square brackets and also the text that is inside these brackets. So that my final text file looks like this:
computer programming
systems engineering
I am using... (3 Replies)
Hi All,
After searching about this, I could find some solutions but I am not sure why it is not working in my case.
I have a text file with contents between two square brackets. The text file looks like this:
Use tags when you post any code so others can easily read your code. You can... (2 Replies)
Hi All -
I am new to unix and scripting. I was asked to export a sql output into .csv format and email the attachment. I could do this however i see some square like boxes or special char at the end of the headings and data values in .csv file. I could not fix this and will need your help.
... (5 Replies)
Please can someone help with this?
I have a file with lines as follows:
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
When I use the... (7 Replies)
I wanted to compare the value inside the Squre bracket after Colon ( : ) based on any value(seperated by or operator | ) inside the variable Thread and if match found then wnated to store in output file
Input file :
20140320 00:08:43.918 INO 35] - Corporate hub is
20140320 00:08:43.918... (2 Replies)
Hi all,
I have a text file similar to this:
Text
More text
Etc
Stuff
That
Is
Needed
Etc
Etc
This contains over 70 entries and each entry has several lines of text below the name in square brackets. (5 Replies)
Discussion started by: Scally
5 Replies
LEARN ABOUT CENTOS
dblink_get_result
DBLINK_GET_RESULT(3) PostgreSQL 9.2.7 Documentation DBLINK_GET_RESULT(3)NAME
dblink_get_result - gets an async query result
SYNOPSIS
dblink_get_result(text connname [, bool fail_on_error]) returns setof record
DESCRIPTION
dblink_get_result collects the results of an asynchronous query previously sent with dblink_send_query. If the query is not already
completed, dblink_get_result will wait until it is.
ARGUMENTS
conname
Name of the connection to use.
fail_on_error
If true (the default when omitted) then an error thrown on the remote side of the connection causes an error to also be thrown locally.
If false, the remote error is locally reported as a NOTICE, and the function returns no rows.
RETURN VALUE
For an async query (that is, a SQL statement returning rows), the function returns the row(s) produced by the query. To use this function,
you will need to specify the expected set of columns, as previously discussed for dblink.
For an async command (that is, a SQL statement not returning rows), the function returns a single row with a single text column containing
the command's status string. It is still necessary to specify that the result will have a single text column in the calling FROM clause.
NOTES
This function must be called if dblink_send_query returned 1. It must be called once for each query sent, and one additional time to obtain
an empty set result, before the connection can be used again.
When using dblink_send_query and dblink_get_result, dblink fetches the entire remote query result before returning any of it to the local
query processor. If the query returns a large number of rows, this can result in transient memory bloat in the local session. It may be
better to open such a query as a cursor with dblink_open and then fetch a manageable number of rows at a time. Alternatively, use plain
dblink(), which avoids memory bloat by spooling large result sets to disk.
EXAMPLES
contrib_regression=# SELECT dblink_connect('dtest1', 'dbname=contrib_regression');
dblink_connect
----------------
OK
(1 row)
contrib_regression=# SELECT * FROM
contrib_regression-# dblink_send_query('dtest1', 'select * from foo where f1 < 3') AS t1;
t1
----
1
(1 row)
contrib_regression=# SELECT * FROM dblink_get_result('dtest1') AS t1(f1 int, f2 text, f3 text[]);
f1 | f2 | f3
----+----+------------
0 | a | {a0,b0,c0}
1 | b | {a1,b1,c1}
2 | c | {a2,b2,c2}
(3 rows)
contrib_regression=# SELECT * FROM dblink_get_result('dtest1') AS t1(f1 int, f2 text, f3 text[]);
f1 | f2 | f3
----+----+----
(0 rows)
contrib_regression=# SELECT * FROM
contrib_regression-# dblink_send_query('dtest1', 'select * from foo where f1 < 3; select * from foo where f1 > 6') AS t1;
t1
----
1
(1 row)
contrib_regression=# SELECT * FROM dblink_get_result('dtest1') AS t1(f1 int, f2 text, f3 text[]);
f1 | f2 | f3
----+----+------------
0 | a | {a0,b0,c0}
1 | b | {a1,b1,c1}
2 | c | {a2,b2,c2}
(3 rows)
contrib_regression=# SELECT * FROM dblink_get_result('dtest1') AS t1(f1 int, f2 text, f3 text[]);
f1 | f2 | f3
----+----+---------------
7 | h | {a7,b7,c7}
8 | i | {a8,b8,c8}
9 | j | {a9,b9,c9}
10 | k | {a10,b10,c10}
(4 rows)
contrib_regression=# SELECT * FROM dblink_get_result('dtest1') AS t1(f1 int, f2 text, f3 text[]);
f1 | f2 | f3
----+----+----
(0 rows)
PostgreSQL 9.2.7 2014-02-17 DBLINK_GET_RESULT(3)