You are welcome.
You could try:
Output:
--
Do multiple records with the same first field only occur for "leaf" (last) values, or can they occur on all levels?
If the latter is the case, could you be more elaborate in what variations can occur and what needs to happen?
Last edited by Scrutinizer; 04-06-2019 at 02:30 AM..
Reason: Replaced ternary if construct by regular if-else statement for clarity reasons
Here is my situation. I need to compare two tab separated files (diff is not useful since there could be known difference between files).
I have found similar posts , but not fully matching.I was thinking of writing a shell script using cut and grep and while loop but after going thru posts it... (2 Replies)
Hi,
I am writing a comparator script, which comapre two txt files(column by column)
below are the precondition of this comparator
1)columns of file are not seperated
Ex.
file1.txt
8888812341181892
1243548895685687
8945896789897789
1111111111111111
file2.txt
9578956789567897... (2 Replies)
Hi,
I need an awk script (or whatever shell-construct) that would take data like below and get the max value of 3 column, when grouping by the 1st column.
clientname,day-of-month,max-users
-----------------------------------
client1,20120610,5
client2,20120610,2
client3,20120610,7... (3 Replies)
Hi, I have a file with +/- 13000 lines and 4 column. I need to search the 3rd column for a word that begins with "SAP-" and move/skip it to the next column (4th). Because the 3rd column need to stay empty.
Thanks in advance.:)
89653 36891 OTR-60 SAP-2
89653 36892 OTR-10 SAP-2... (2 Replies)
Input file :
5 20
500 2
20 41
41 0
23 1
Desired output :
5
2
20
0
1
By comparing column 1 and 2 in each line, I hope can print out the column with smallest number.
I did try the following code, but it don't look good :( (2 Replies)
I have the following 2 files.
File 1
08FB,000192602673,10000000c9a6b240
0121,000192602673,20000025b550101f
0121,000192602673,20000025b550100f
08FA,000192602673,10000000c9a6b240
File 2
18F2,000195702363,10000000c9a6b240
18F3,000195702363,10000000c9a6b240... (2 Replies)
input
"A","B","C,D","E","F"
"S","T","U,V","W","X"
"AA","BB","CC,DD","EEEE","FFF"
required output:
"A","B","C,D","C,D","F"
"S", T","U,V","U,V","X"
"AA","BB","CC,DD","CC,DD","FFF"
tried using awk but double quotes not preserving for every field. any help to solve this is much... (5 Replies)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Discussion started by: TestPractice
5 Replies
LEARN ABOUT PHP
sql-acceptable-by-4d
SQL-ACCEPTABLE-BY-4D(3) 1 SQL-ACCEPTABLE-BY-4D(3)SQL acceptable by 4D - PDO and SQL 4D
4D implements strictly the ANSI 89 standard, and have it enforced. It is highly recommended to read the 4D SQL documentation to learn
about the available commands. The URL of the manual is : http://doc.4d.com/. Below is a list of 4D SQL characteristics: it is not exhaus-
tive, but may serve as an introduction.
Characteristics of 4D SQL
+-------------------------------------+--------------------------------------+---+
| Characteristics | | |
| | | |
| | Alternative | |
| | | |
| | Note | |
| | | |
+-------------------------------------+--------------------------------------+---+
| INTEGER | | |
| | | |
| | Modify the SQL to use INT. | |
| | | |
| | INT is the supported integer type in | |
| | 4Dv12.0. | |
| | | |
| CHAR | | |
| | | |
| | Use VARCHAR instead. | |
| | | |
| | Unsupported in 4Dv12.0 | |
| | | |
| UNION | | |
| | | |
| | Unsupported. Make separate queries. | |
| | | |
| | Unsupported in 4Dv12.0 | |
| | | |
| SELECT 1 + 1; | | |
| | | |
| | SELECT 1 + 1 FROM _USER_SCHEMAS; | |
| | | |
| | FROM is required | |
| | | |
| FLOAT | | |
| | | |
| | Cast the FLOAT value into a FLOAT or | |
| | STRING, with an SQL 4D function | |
| | (CAST, ROUND, TRUNC or TRUNCATE) | |
| | | |
| | Unsupported in current versions of | |
| | the PDO_4D driver | |
| | | |
| Strong typing | | |
| | | |
| | Take care your SQL query, or your | |
| | PHP code provides data with the | |
| | expected type | |
| | | |
| | One must provide the right type | |
| | that 4D expect. One can't insert '1' | |
| | (as a string) in an INTEGER column. | |
| | | |
|PDO.execute(row)(3) : only works if | | |
|all the table's column are of type | | |
|TEXT or VARCHAR | | |
| | | |
| | Use the prepared statements, and use | |
| | the right types. | |
| | | |
| | The PDO extension cast all values | |
| | through execute() as string, and | |
| | expect the SQL database to parse the | |
| | values. | |
| | | |
| SELECT NULL FROM TABLE | | |
| | | |
| | Do not use NULL constants. Extract | |
| | them from the table | |
| | | |
| | It is not allowed to use the NULL | |
| | constant in the select list | |
| | | |
| SELECT * FROM TABLE WHERE 1 | | |
| | | |
| | Use WHERE 1 = 1 | |
| | | |
| | A constant can't be used in a WHERE | |
| | clause | |
| | | |
| SHOW TABLES | | |
| | | |
| | Use system tables | |
| | | |
| | The list of tables, schemas, index, | |
| | etc. are in these system tables : | |
| | _USER_TABLES, _USER_COLUMNS, | |
| | _USER_INDEXES, _USER_CONSTRAINTS, | |
| | _USER_IND_COLUMNS, _USER_CONS_COL- | |
| | UMNS, and _USER_SCHEMAS. | |
| | | |
| SQL structure delimiter | | |
| | | |
| | Use the following function to pro- | |
| | tect SQL elements: function | |
| | sqlEscapeElement(elem) { return '[' | |
| | . str_replace(']',']]', $elem) . | |
| | ']'; } | |
| | | |
| | To escape SQL elements names | |
| | (tables, fields, users, groups, | |
| | schema, primary key, etc.), the | |
| | whole identifier must be between | |
| | square brackets, and the closing | |
| | brackets ']' must be doubled. | |
| | | |
+-------------------------------------+--------------------------------------+---+
PHP Documentation Group SQL-ACCEPTABLE-BY-4D(3)