I am new to scripting and I have a requirement
we have source file as
Here record starting with 'TA' is the name of the tables, then followed by data with semicolon delimited.
Ex: TA0022 table has no data, TA0000 table has 15 records data and so on.
Now the requirement is to split the above source file into 7 different files i.e.table wise, TA0022,TA0000, TA0035,TA0002,TA0016,TA0006, TA0086(same names) with the associated data in it.
Here both the number of files as well as data are varied but the table name starts with 'TA'
Hi,
I have an input file like:
111
abcdefgh
asdfghjk
dfghjkl
222
aaaaaaa
bbbbbb
333
djfhfgjktitjhgfkg
444
djdhfjkhfjkghjkfg
hsbfjksdbhjkgherjklg
fjkhfjklsahjgh
fkrjkgnj
I want to read this input file and make separate output files with the header as numric value like "111"... (9 Replies)
Hi
extending to one of my previous posted query ....
I am using
nawk -v invar1="$aa" '{print > ("ABS\_"((/\|/)?"A\_":"B\_")invar1"\_NETWORKID.txt")}' spfile.txt
to get 2 different files based on split condition i.e. "|"
Similar to invar1 variable in nawk I also need one more variable... (18 Replies)
Hi,
I have a requiement where in i will get a single file but there will be mutiple headers.
Suppose say for eg:
Header1
Data...
Data...
Header2
Data..
Data..
Header3
Data..
Data..
I want to split each with the corresponding data into a single file.
Please let me know how... (1 Reply)
I have a bif text file with the following format:
d1_03 fr:23
d1_03 fr:56
d1_03 fr:67
d1_03 fr:78
d1_01 fr:35
d1_01 fr:29
d1_01 fr:45
d2_09 fr:34
d2_09 fr:78
d3_98 fr:90
d3_98 fr:104
d3_98 fr:360
I have like thousands of such lines
I want to reformat this file based on column 1... (3 Replies)
I was given a data file that I need to split into multiple lines/records based on a key word. The problem is that it is 2.5GB or bigger and everything I try in perl or sed causes a Segmentation fault. Can someone give me some other ideas.
The data is of the form:... (5 Replies)
I have a file in unix with sample data as follows :
--------------------------------------------------------------
--------------------------------------------------------------
{30001002|XXparameter|Layout|$
I want this file to be splitted into different files and corresponding to the sample... (54 Replies)
Hi Friends ,
Please guide me with the code to extract multiple files from one file .
The File Looks like ( Suppose a file has 2 tables list ,column length may vary )
H..- > File Header....
H....- >Table 1 Header....
D....- > Table 1 Data....
T....- >Table 1 Trailer....
H..-> Table 2... (1 Reply)
hdr=$(cut -c1 $path$file|head -1)#extract header”H”
trl=$(cut -c|path$file|tail -1)#extract trailer “T”
SplitFile=$(cut -c 50-250 $path 1$newfile |sed'$/ *$//' head -1')# to trim white space and extract table name
If; then # start loop if it is a header
While read I #read file
Do... (4 Replies)
Hi,
I have 2 csv/txt files with single columns. I am trying to merge them using paste, but its not working..
output3.csv:
flowerbomb
everlon-jewelry
sofft
steve-madden
dolce-gabbana-watchoutput2.csv:
http://www1.abc.com/cms/slp/2/Flowerbomb
http://www1.abc.com/cms/slp/2/Everlon-Jewelry... (5 Replies)
Hi,
I'm having a xml file with multiple xml header. so i want to split the file into multiple files.
Sample.xml consists multiple headers so how can we split these multiple headers into multiple files in unix.
eg :
<?xml version="1.0" encoding="UTF-8"?>
<ml:individual... (3 Replies)
Discussion started by: Narendra921631
3 Replies
LEARN ABOUT REDHAT
create_table_as
CREATE TABLE AS(7) SQL Commands CREATE TABLE AS(7)NAME
CREATE TABLE AS - create a new table from the results of a query
SYNOPSIS
CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name [ (column_name [, ...] ) ]
AS query
DESCRIPTION
CREATE TABLE AS creates a table and fills it with data computed by a SELECT command. The table columns have the names and data types asso-
ciated with the output columns of the SELECT (except that you can override the column names by giving an explicit list of new column
names).
CREATE TABLE AS bears some resemblance to creating a view, but it is really quite different: it creates a new table and evaluates the query
just once to fill the new table initially. The new table will not track subsequent changes to the source tables of the query. In contrast,
a view re-evaluates its defining SELECT statement whenever it is queried.
PARAMETERS
[LOCAL] TEMPORARY or [LOCAL] TEMP
If specified, the table is created as a temporary table. Refer to CREATE TABLE [create_table(7)] for details.
table_name
The name (optionally schema-qualified) of the table to be created.
column_name
The name of a column in the new table. Multiple column names can be specified using a comma-delimited list of column names. If col-
umn names are not provided, they are taken from the output column names of the query.
query A query statement (that is, a SELECT command). Refer to SELECT [select(7)] for a description of the allowed syntax.
DIAGNOSTICS
Refer to CREATE TABLE [create_table(7)] and SELECT [select(7)] for a summary of possible output messages.
NOTES
This command is functionally equivalent to SELECT INTO [select_into(7)], but it is preferred since it is less likely to be confused with
other uses of the SELECT ... INTO syntax.
COMPATIBILITY
This command is modeled after an Oracle feature. There is no command with equivalent functionality in SQL92 or SQL99. However, a combina-
tion of CREATE TABLE and INSERT ... SELECT can accomplish the same thing with little more effort.
HISTORY
The CREATE TABLE AS command has been available since PostgreSQL 6.3.
SEE ALSO
CREATE TABLE [create_table(7)], CREATE VIEW [create_view(l)], SELECT [select(l)], SELECT INTO [select_into(l)]
SQL - Language Statements 2002-11-22 CREATE TABLE AS(7)