Input Files:
File1.txt
A 1 B 1 C 1
File2.txt
A 2 2 B 2 2 C 2 2
File3.txt
A 3 3 3 B 3 3 3 C 3 3 3
File4.txt
A 4 4 4 4 B 4 4 4 4 C 4 4 4 4
Output:
Number of input files: 4 A 4 4 4 4 1 3 3 3 2 2 B 4 4 4 4 1 3 3 3 2 2 C 4 4 4 4 1 3 3 3 2 2
$bash /home/duy/workspace/tests.sh -d /home/duy/workspace/tests -e "txt"
$sh mergeFiles.sh ./ (merge all files under current directory)
or by specifying file extension
$sh mergeFiles.sh ./ trec_eval (merge all trec_eval files under current directory)
or by using specific options
$sh mergeFiles.sh -d inputDir -e txt -b 2 (... but skip second column from original files)
$sh mergeFiles.sh -d inputDir -e txt -r (... but skip first column (header) in the final result file)
Log in to post a comment.
Input Files:
File1.txt
A 1
B 1
C 1
File2.txt
A 2 2
B 2 2
C 2 2
File3.txt
A 3 3 3
B 3 3 3
C 3 3 3
File4.txt
A 4 4 4 4
B 4 4 4 4
C 4 4 4 4
Output:
Number of input files: 4
A 4 4 4 4 1 3 3 3 2 2
B 4 4 4 4 1 3 3 3 2 2
C 4 4 4 4 1 3 3 3 2 2
$bash /home/duy/workspace/tests.sh -d /home/duy/workspace/tests -e "txt"
$sh mergeFiles.sh ./
(merge all files under current directory)
or by specifying file extension
$sh mergeFiles.sh ./ trec_eval
(merge all trec_eval files under current directory)
or by using specific options
$sh mergeFiles.sh -d inputDir -e txt -b 2
(... but skip second column from original files)
$sh mergeFiles.sh -d inputDir -e txt -r
(... but skip first column (header) in the final result file)
Last edit: Duy Dinh 2013-10-04