Sponsored Content
Top Forums Shell Programming and Scripting Replacing first word while extracting Post 302847895 by MR.bean on Wednesday 28th of August 2013 04:19:04 AM
Old 08-28-2013
Like that?

Code:
bash-3.2$ awk 'BEGIN{x=1} /DEFINE SCHEMA/,/\)\;/ {if (NF==2) { $1="t"x" as filler"; print; x++ }}' filename
t1 as filler VARCHAR(10)

This User Gave Thanks to MR.bean For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting from second word

Hi all, I need to extract the Particular string from the whole word,the input file is : 123,345,aaaa,555,....,.... I need all the record from 345 so i need to eliminate the first record. Output: 345,aaa,5555,....,.....,..... Thanks in advance. (3 Replies)
Discussion started by: ithirak17
3 Replies

2. Shell Programming and Scripting

replacing files in an EAR file after extracting

{Hello All, Here is what I am trying to do: I have an archive file: AppName.ear jar -tvf AppName.ear 60459 Thu May 01 09:29:36 EDT 2008 /SharedResources/Application/App.dat 67542 Thu May 01 09:29:36 EDT 2008 JDBCConn/Application/App.dat 14488 Thu May 01 09:29:36 EDT 2008 config.xml ... (0 Replies)
Discussion started by: chiru_h
0 Replies

3. Shell Programming and Scripting

Replacing of word

Hi all, I wanted to replace one word with another word pl help me to solve the same. example:- I wanted to replace RXOTX with RXOTRX in a perticuler file with hole. Regards, Ramesh (2 Replies)
Discussion started by: Ramesh Vellanki
2 Replies

4. Shell Programming and Scripting

Replacing word and Incrementing

Hi I'm having difficulty in writing a script with searching a specified word using sed and replaces that word with numbers that is incremented I tried this: #!/bin/sh awk '{ for (i=2010; i<=NF; i++) sed 's/TBA/$i; }' filename.txt > outputfile.txt but it doesn't work. here is my desired... (1 Reply)
Discussion started by: sexyTrojan
1 Replies

5. UNIX for Dummies Questions & Answers

regular expression for replacing the fist word with a last word in line

I have a File with the below contents File1 I have no prior experience in unix. I have just started to work in unix. My experience in unix is 0. My Total It exp is 3 yrs. I need to replace the first word in each line with the last word for example unix have no prior experience in... (2 Replies)
Discussion started by: kri_swami
2 Replies

6. Shell Programming and Scripting

Replacing a word

Dear Friends, I am facing some problem with some hundred files. Hence to use these file I have to make a small change in each file. But its not possible to open each file and make changes manually. Hence I need guidance frm you to automate it. Example File name is "Queue_11.txt" reload sec=F... (6 Replies)
Discussion started by: anushree.a
6 Replies

7. Shell Programming and Scripting

extracting sentences that only contain a word

Hi guys Need your help how do I extract sentences with only a word i.e. today is hot hot very humid humid2 Sample output hot (6 Replies)
Discussion started by: jamestan
6 Replies

8. Shell Programming and Scripting

Extracting a word from a variable

Hi Guys, Need you quick assistance on the below, trying to extract a word from a variable i.e. acmi101acmi102acmi103acmi104 When i use the following code awk '{gsub(/cmi102/,"")};1' it leaves a space in the variable, need to get rid of the space that it leaves. Any ideas. the above... (3 Replies)
Discussion started by: eo29
3 Replies

9. Shell Programming and Scripting

Replacing a particular word with another word in all the xml's under a particular directory with sed

Hi Folks, Could you please advise what will be the SED command to replace a word in all xml's under a particular directory for example let say I rite now at the following below location $ cd /ter/rap/config now under config directory there will be lots of xml file , now my objective is to... (1 Reply)
Discussion started by: punpun66
1 Replies

10. Shell Programming and Scripting

Replacing the first word if the word three match

Dear ALL, I have sample file : IDcentos-forum,bash,linuxCentOS,GNome IEfedora-milis,cli,linuxRedhat,KDE IRfreebsd-milis,aix,unixbsd,pyton required output: centos,bash,linuxCentOS,GNome fedora,cli,linuxRedhat,KDE freebsd,aix,unixbsd,pyton Can you help me pls.. (1 Reply)
Discussion started by: gnulyn
1 Replies
CREATE 
SCHEMA(7) PostgreSQL 9.2.7 Documentation CREATE SCHEMA(7) NAME
CREATE_SCHEMA - define a new schema SYNOPSIS
CREATE SCHEMA schema_name [ AUTHORIZATION user_name ] [ schema_element [ ... ] ] CREATE SCHEMA AUTHORIZATION user_name [ schema_element [ ... ] ] DESCRIPTION
CREATE SCHEMA enters a new schema into the current database. The schema name must be distinct from the name of any existing schema in the current database. A schema is essentially a namespace: it contains named objects (tables, data types, functions, and operators) whose names can duplicate those of other objects existing in other schemas. Named objects are accessed either by "qualifying" their names with the schema name as a prefix, or by setting a search path that includes the desired schema(s). A CREATE command specifying an unqualified object name creates the object in the current schema (the one at the front of the search path, which can be determined with the function current_schema). Optionally, CREATE SCHEMA can include subcommands to create objects within the new schema. The subcommands are treated essentially the same as separate commands issued after creating the schema, except that if the AUTHORIZATION clause is used, all the created objects will be owned by that user. PARAMETERS
schema_name The name of a schema to be created. If this is omitted, the user_name is used as the schema name. The name cannot begin with pg_, as such names are reserved for system schemas. user_name The role name of the user who will own the new schema. If omitted, defaults to the user executing the command. To create a schema owned by another role, you must be a direct or indirect member of that role, or be a superuser. schema_element An SQL statement defining an object to be created within the schema. Currently, only CREATE TABLE, CREATE VIEW, CREATE INDEX, CREATE SEQUENCE, CREATE TRIGGER and GRANT are accepted as clauses within CREATE SCHEMA. Other kinds of objects may be created in separate commands after the schema is created. NOTES
To create a schema, the invoking user must have the CREATE privilege for the current database. (Of course, superusers bypass this check.) EXAMPLES
Create a schema: CREATE SCHEMA myschema; Create a schema for user joe; the schema will also be named joe: CREATE SCHEMA AUTHORIZATION joe; Create a schema and create a table and view within it: CREATE SCHEMA hollywood CREATE TABLE films (title text, release date, awards text[]) CREATE VIEW winners AS SELECT title, release FROM films WHERE awards IS NOT NULL; Notice that the individual subcommands do not end with semicolons. The following is an equivalent way of accomplishing the same result: CREATE SCHEMA hollywood; CREATE TABLE hollywood.films (title text, release date, awards text[]); CREATE VIEW hollywood.winners AS SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL; COMPATIBILITY
The SQL standard allows a DEFAULT CHARACTER SET clause in CREATE SCHEMA, as well as more subcommand types than are presently accepted by PostgreSQL. The SQL standard specifies that the subcommands in CREATE SCHEMA can appear in any order. The present PostgreSQL implementation does not handle all cases of forward references in subcommands; it might sometimes be necessary to reorder the subcommands in order to avoid forward references. According to the SQL standard, the owner of a schema always owns all objects within it. PostgreSQL allows schemas to contain objects owned by users other than the schema owner. This can happen only if the schema owner grants the CREATE privilege on his schema to someone else, or a superuser chooses to create objects in it. SEE ALSO
ALTER SCHEMA (ALTER_SCHEMA(7)), DROP SCHEMA (DROP_SCHEMA(7)) PostgreSQL 9.2.7 2014-02-17 CREATE SCHEMA(7)
All times are GMT -4. The time now is 11:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy