I need to write a shell script which combines/joins 3 text files into one file. Do i put the txt files in the same folder as my script? Here is what i have:
#!/bin/bash
file1=$1
file2=$2
file3=$3
out="output.txt"
count=0
if
then
echo "$(basename $0) file1 file2 file3"
... (3 Replies)
Hi there,
I was wondering if someone can help me with this.
I am trying the combine multiple columns from multiple files into one file.
Example file 1:
c0t0d0 c0t2d0 # hostname vgname
c0t0d1 c0t2d1 # hostname vgname
c0t0d2 c0t2d2 # hostname vgname
c0t1d0 c0t3d0 # hostname vgname1... (5 Replies)
hi people;
this is my file1.txt:192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
...
this is my file2.txt:portnames
usernames
maxusercap
...
i want to write to file3.txt:l ./getports 192.168.1.1 'get all;l+;get . portnames;l-'
l ./getports 192.168.1.1 'get all;l+;get . usernames;l-'... (4 Replies)
Hello everybody,
I have a text file containing 10,000 rows and 5000 columns. The values are separated by a tab.
Ex.
file_ex.ped
1 mike 0 0 2 1 A A G G C T A G
1 jack 0 0 2 2 T A G T C A A C
1 Mary 0 0 1 2 A T G C A T G C
...
I would like a out put file
1 mike 0 0 2 1 AA GG CT AG
1... (7 Replies)
This may seem obvious but I am having problems doing this as columns get converted to rows when i try to write a script.
I have 2 files text1.txt and text2.txt each of which have 6 columns of numbers separated by a space.
I need to combine the 2 files so that the output file text3.txt maintains... (2 Replies)
Hello everyone,
I searched the forum looking for answers to this but I could not pinpoint exactly what I need as I keep having trouble.
I have many files each having two columns and hundreds of rows.
first column is a string (can have many words) and the second column is a number.The files are... (5 Replies)
Hi,
How can I combine the data of of three files into one new file?
I try to give as much informations as possible.
The three existing files are called file1 file2 and file3
the new file should named output_combined.
The size of the files will be around 900 words/lines each .. but always... (5 Replies)
comb(1) General Commands Manual comb(1)NAME
comb - Combines Source Code Control System (SCCS) deltas
SYNOPSIS
comb [-clist] [-os] [-pSID] file...
The comb command writes to standard output a shell procedure for combining the specified deltas (SIDs) of an SCCS file and creating a new
version of the file with fewer deltas.
OPTIONS
Each option or group of options applies independently to each named file. Specifies a list of deltas (SIDs) that the shell procedure will
preserve (see get -ilist). The procedure will combine all other deltas. Accesses the reconstructed file at the release of the delta to be
created for each get -e generated; otherwise, accesses the reconstructed file at the most recent ancestor. Using the -o option may
decrease the size of the reconstructed SCCS file. It may also alter the shape of the delta tree of the original file. Specifies the SID
of the oldest delta for the resulting procedure to preserve. All older deltas are combined in the reconstructed file. Causes comb to gen-
erate a shell procedure that, instead of combining the deltas, produces a report for each file, which lists the file name, size (in blocks)
after combining, original size (also in blocks), and percentage change computed by the following formula: 100 * (original - combined) /
original
Run comb using this option before actually combining SCCS deltas in order to judge how much space will actually be saved by the com-
bining process.
DESCRIPTION
By piping the output of the comb command to a shell, or redirecting the output to a file and running that file as a shell procedure, you
can reduce the size of your SCCS file. You can first see how much the file will be reduced by running the comb command with the -s option.
If you specify a directory in place of file, the comb command performs the requested actions on all SCCS files (that is, those with file
names with the s. prefix). If you specify a - (dash) in place of file, the comb command reads standard input and interprets each line as
the name of an SCCS file. The comb command continues to take input until it reads End-of-File.
If you do not specify any options, the comb command preserves only leaf deltas and the minimal number of ancestors needed to preserve the
tree (see the delta command).
The comb command may rearrange the shape of the tree deltas.
The comb command may not save any space; in fact, it is possible for the reconstructed file to actually be larger than the original.
EXAMPLES
To generate a report on how much space will be saved by combing all deltas older than SID 1.4 for SCCS file s.test.c, enter: comb -p1.4 -s
s.test.c | sh To actually combine the deltas, enter: comb -p1.4 s.test.c | sh
FILES
Temporary files.
SEE ALSO
Commands: admin(1), cdc(1), delta(1), get(1), prs(1), rmdel(1), sact(1), sccs(1), sccsdiff(1), sccshelp(1), unget(1), val(1), what(1)
Files: sccsfile(4)
Programming Support Tools
comb(1)