Computing.Net > Forums > Unix > concatenate files using CAT

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

concatenate files using CAT

Reply to Message Icon

Name: johnston
Date: April 27, 2001 at 07:49:42 Pacific
Comment:

Hi there,

I use cat *.txt > junk.lst to concatenate all the txt file in current directory into a big file called junk.lst for later processing, my problem is that for each txt file, I want to delete the very first line (recorder) before they are put together. Is there any way to do that?

Thanks

Johnston



Sponsored Link
Ads by Google

Response Number 1
Name: een
Date: May 9, 2001 at 04:09:20 Pacific
Reply:

A small for loop using sed could be the answer.
You could do something like ...

rm junk.txt
for i in *.txt
do
sed -e '1d' $i >> junk.txt
done


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: concatenate files using CAT

concatenate files with identifier www.computing.net/answers/unix/concatenate-files-with-identifier/8249.html

cat concatenate deleting first line www.computing.net/answers/unix/cat-concatenate-deleting-first-line/8252.html

How to convert text file to html www.computing.net/answers/unix/how-to-convert-text-file-to-html/4709.html