I have two directories, each have 27 files with same name and now I want to combine them one by one into another directory with same names.
I dont know how to use "and" for the "for loop" so it will not go in the circle.
so my code has a problem I dont know how to fix
file01 has 2 column and file02 has 1 and I need to add another to columns to the paste above one is columns 2 of the AB=file01-1 and other is file02-AB.
would it be possible to combine them in the code above ?
file01
james
20
hanna
34
file02
40
55
desired combined file
jame
20
40
21
19
hanna
34
55
35
20
Last edited by joeyg; 09-10-2012 at 02:25 PM..
Reason: Fixed spelling of title
I have two files which contain data from two different transactions in the same format:
<Name> - <Count>
My goal is to end up with data in this format after combining the two:
<Name> - <Count1> - <Count2>
Is this possible to do with awk, or is there something better?
Thanks... (3 Replies)
Could someone help me reduce the number of runs for a shell program I created?
I have two text files below:
$ more list1.txt
01 AAA
02 BBB
03 CCC
04 DDD
$ more list2.txt
01 EEE
02 FFF
03 GGG
I want to combine the lines with the same number to get the below:
01 AAA 01 EEE
02... (4 Replies)
Hi Gurus,
I have 2 files:
File1
Filename1 xx
Filename1 yy
Filename1 Total
Filename2 xx
Filename2 yy
Filename2 zz
Filename2 Total
Filename3 xx
Filename3 Total
and File2:
Filename1 10296 xxx Date: 09/01/08
Filename2 10296 xxx Date: 09/05/08... (36 Replies)
Hi,
Please help me, how to get all the direcotries, its sub directories and its sub directories recursively, need to exclude all the files in the process.
I wanted to disply using a unix command all the directories recursively excluding files.
I tried 'ls -FR' but that display files as... (3 Replies)
Hi All,
Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below,
1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
i am having 2 files like this
file 1
1,
2,
3,
4,
file2
5,
6,
7,
8,
what i want do is like this
i want to put all the contents for file 2 after file 1,means adding column in file1 (5 Replies)
Hi I have about 108 files (text files) that end with .avg and each one of these files have a distinct name that describes what is in the file. In each file there is a set of 80 values that are tab separated. I want to combine all 108 files into ONE main file.
So each file is named:
1.avg... (5 Replies)
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex.
so
mydemo--2015-03-23-1500.tar.gz
> database
-... (5 Replies)
Discussion started by: wyclef
5 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)