Merge unix Files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Merge unix Files
# 1  
Old 08-06-2010
Merge unix Files

Please help me with script

i am trying to remove the first four line from multiples files and them merge them into one file. I am using:

ls -l csddate*.txt | sed -i '4d' >> file.txt

could this work?
# 2  
Old 08-06-2010
Code:
for i in csddate*.txt
do
sed "1,4d" $i >> file.txt
done

# 3  
Old 08-07-2010
Hi

Code:
awk 'FNR>4' csddate*.txt > file.txt

Guru.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge 3 files

help with a command please i have 3 files that i need to merge in to a 4th file using awk or sed the files have more than 3 lines in them file 1 AAA BBB CCCfile 2 AAA BBB CCCfile 3 AAA BBB CCCi want the 4th file to look like this after merging AAA AAA AAA (3 Replies)
Discussion started by: bob123
3 Replies

2. Shell Programming and Scripting

Merge files and generate a resume in two files

Dear Gents, Please I need your help... I need small script :) to do the following. I have a thousand of files in a folder produced daily. I need first to merge all files called. txt (0009.txt, 0010.txt, 0011.txt) and and to output a resume of all information on 2 separate files in csv... (14 Replies)
Discussion started by: jiam912
14 Replies

3. Shell Programming and Scripting

How to merge two files?

Hi Gurus, I have two files as below file1 abc cde cdd cdf file2 123 234 345 456 I want to get abc 123 cde 234 cdd 345 (3 Replies)
Discussion started by: ken6503
3 Replies

4. Shell Programming and Scripting

Checking in a directory how many files are present and basing on that merge all the files

Hi, My requirement is,there is a directory location like: :camp/current/ In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Discussion started by: srikanth_sagi
10 Replies

5. UNIX for Dummies Questions & Answers

Merge files

Hi, I would like to know how can I merge files based on their coordinates, but mantaining the score of each file in the output file like: Note: 1st column is for chromosome, 2nd for start, 3rd for end of segment, 4th for score file1: 1 200 300 20 1 400 500 30 file2: 1 200 350 30 1... (1 Reply)
Discussion started by: fadista
1 Replies

6. Shell Programming and Scripting

Merge files

Hello, I have a application software plink. It can merge files with some kinds of way. The command likes: plink --file 1 --merge 2 --recode --out merged That means merge file 1 and 2 then output file "merged". However I have 23 files (1,2,3,...22,23)to be merged together. How can I use... (2 Replies)
Discussion started by: zhshqzyc
2 Replies

7. Shell Programming and Scripting

how to merge two C/C++ files?

Can anybody help me to merge two C files using awk, sed or anything else? Thanks! File 1: #ifdef HDEADER1 #include “header1.h” #endif Fun1() { } File2: #ifdef HDEADER2 #include “header2.h” #endif Fun2() { } (2 Replies)
Discussion started by: GoldenSmith
2 Replies

8. Shell Programming and Scripting

Merge 2 files

Hi , This might be the stupidest question I am asking, but I am struck with this problem. I am trying to merge 2 files, file1 has header and file2 has contents. while I merge them , it merges from the 1st line of file1. for ex: file1 col1|col2|col3| file2 123|234|456|... (2 Replies)
Discussion started by: rashmisb
2 Replies

9. UNIX for Dummies Questions & Answers

Merge lines together in unix

I have a file like this. Pls help me to solve this in ksh (I should look for only Message : 111 and need to print the start time to end time Need to ignore other type of messages. Ex: if first message is 111 and second message is 000 or anything else then ignore the 2nd one and print start time... (7 Replies)
Discussion started by: mnjx
7 Replies

10. Shell Programming and Scripting

Merge files of differrent size with one field common in both files using awk

hi, i am facing a problem in merging two files using awk, the problem is as stated below, file1: A|B|C|D|E|F|G|H|I|1 M|N|O|P|Q|R|S|T|U|2 AA|BB|CC|DD|EE|FF|GG|HH|II|1 .... .... .... file2 : 1|Mn|op|qr (2 Replies)
Discussion started by: shashi1982
2 Replies
Login or Register to Ask a Question