Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-29-2005, 04:37 AM   #1
LQ Newbie
Registered: Jun 2005
Posts: 18

Rep: Reputation: 0
Question about copying lines from Ascii file

Dear *,

I just have a question regarding copying ascii file's content.

I need to copy part of contents (e.g from line 382 to line 582) from a log file which is ASCII format.

Is there any command to copy line 382 to line 582 to another file?

Thanks and RGDS
Old 09-29-2005, 05:11 AM   #2
Registered: May 2001
Location: Germany, Sd-Baden
Distribution: Gentoo
Posts: 139

Rep: Reputation: 15
you can try to

cat <asciifile>

and use the




command. See their man pages for the syntax
Old 09-29-2005, 07:22 AM   #3
Senior Member
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
sed -n '382,582 p' logfile.log >destfile.log

should work.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert ASCII text to an audio file ed_homeLinux Linux - Software 1 07-22-2005 01:30 PM
line numbering in ASCII file rohr Programming 4 03-18-2005 10:14 AM
Question on File System and File Copying hey_joe Linux - Newbie 2 11-05-2003 11:30 AM
Printing a linux ASCII file in windows ChimpFace9000 Linux - General 2 05-05-2002 07:00 PM
Displaying a text file in ascii?? bauld Linux - General 4 11-21-2001 08:33 PM

All times are GMT -5. The time now is 06:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration