Appending multiple files through UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Appending multiple files through UNIX
# 1  
Old 08-22-2017
Appending multiple files through UNIX

Hi All,
I have requirement where multiple csv files are present in a directory and each file contains a header.I need to append the contents of all the files into one file by removing header.
Once the data is merged in one file ,I need to remove duplicates on nth column to find out distinct record on the merged file.Can anyone please help me with this through unix scripting.Thanks in advance.
# 2  
Old 08-22-2017
Could you give a short example of input files and expected output file?
Did you make any attempt yet?
# 3  
Old 08-22-2017
When removing duplicates, which of the records should be kept?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies

2. Shell Programming and Scripting

Appending different columns of multiple files in awk

Hello All, I have three input files cat file1 col1|col2|col3 a|1|A b|2|B cat file2 col1|col2|col3 c|3|C cat file3 col1|col2|col3 d|4|D e|5|E i want below output file4 col1|col2 a|1 (6 Replies)
Discussion started by: looney
6 Replies

3. UNIX for Beginners Questions & Answers

Appending time stamp for multiple file

Hi All, I am trying to append time stamp to all file with wild character. If you look above I want take all file with wild card *001* and append current time stamp to it. I did below code. But not sure if there is any easy way that can be done in a single step a=date +%s for... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

4. Shell Programming and Scripting

Copying multiple files and appending time stamp before file extension

Hi, I have multiple files that read: Asa.txt Bad.txt Gnu.txt And I want to rename them using awk to Asa_ddmmyytt.txt and so on ... If there is a single command or more efficient executable please share! Thanks! (4 Replies)
Discussion started by: Jesshelle David
4 Replies

5. UNIX for Dummies Questions & Answers

Appending multiple files

I am trying to append multiple files in a directory cat /a/file1.txt /a/file2.txt /a/file3.txt /a/file4.txt > /a/file.txt Except file2 every other file is appending. I interchanged file names and ran the command. Whatever file repeating in the second position is missing in output... (6 Replies)
Discussion started by: eskay
6 Replies

6. Shell Programming and Scripting

Appending authorized_keys on multiple servers using ssh

Hi I have an ssh 'for' loop script to login and put a key on multiple servers. I need to append a file on each server but the command which works ok from the prompt does not work via the script. I have cat filename | ssh user@servername "cat >>append.file.name" I have tried to 'spawn' this in... (0 Replies)
Discussion started by: Grueben
0 Replies

7. Shell Programming and Scripting

Create Multiple UNIX Files for Multiple SQL Rows output

Dear All, I am trying to write a Unix Script which fires a sql query. The output of the sql query gives multiple rows. Each row should be saved in a separate Unix File. The number of rows of sql output can be variable. I am able save all the rows in one file but in separate files. Any... (14 Replies)
Discussion started by: Rahul_Bhasin
14 Replies

8. UNIX for Dummies Questions & Answers

Help needed in Appending multiple lines

Hello, There is a log file A.log where new lines are getting added every minute. When ever any new lines are getting added in to A , the same lines needs to be appended to B.log I need to append these newly added lines to end of another file B through a shell script. I tried CAT but its... (2 Replies)
Discussion started by: twisterboy
2 Replies

9. Shell Programming and Scripting

reversing and appending data in multiple files

Hello, I have a some files that look like this: 0 3 1 5 2 8 3 7 I want to reverse and append the data so it looks like this: 3 7 2 8 1 5 0 3 0 3 1 5 2 8 3 7 I first thought about using cat and tac cleverly with some redirection and pipe in a one-liner but I couldn't get it to... (1 Reply)
Discussion started by: bigfoot
1 Replies

10. Shell Programming and Scripting

Appending same tring to multiple files in one line?

I have a string that I need to append to 3 files. Say, $ echo "Hello" I want to append this “Hello” to three files, file1, file2 and file3.The files are all in different directories and the file names have no common pattern.Can I do it in one line? If yes, how? :confused: (2 Replies)
Discussion started by: zombiezparadize
2 Replies
Login or Register to Ask a Question