Computing.Net > Forums > Unix > write n rows from file a to file b

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.

write n rows from file a to file b

Reply to Message Icon

Name: flipke
Date: October 20, 2006 at 00:21:03 Pacific
OS: Unix
CPU/Ram: -
Product: -
Comment:

Hi all,

I'm trying to write the first 50 rows from file A to a new file. By using 'head -50 fileA' i know i get to see the first 50 rows of that file. By using the pipe i should be able to get it done, but don't get it done :-( Can anybody help me out? Thanx!



Sponsored Link
Ads by Google

Response Number 1
Name: flipke
Date: October 20, 2006 at 00:45:53 Pacific
Reply:

Tried to do some more with the pipe-command and finally found the solution:

head -50 fileA | cat > fileB



0

Response Number 2
Name: nails
Date: October 20, 2006 at 06:37:04 Pacific
Reply:

There's no need to pipe it to cat before redirecting:

head -50 fileA > fileB


0

Sponsored Link
Ads by Google
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: write n rows from file a to file b

Status of a remote file using SCP? www.computing.net/answers/unix/status-of-a-remote-file-using-scp/7390.html

Installing Unix www.computing.net/answers/unix/installing-unix/5867.html

tar and gunzip help please www.computing.net/answers/unix/tar-and-gunzip-help-please/2063.html