[x] Welcome to LinuxSolved.com Linux help forums, here we are a community of Linux users helping each other. It is helpful to both ie. new linux users as well experienced one. We always have our experts to help you and ofcourse members help each other, so you can ask for help any time by Registering.: Click to Register

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Linux Forums - Linux Help,Advice & support community:LinuxSolved.com  |  Forum  |  Network Troublshooting  |  Linux Servers Support  |  Topic: Please tell me about this
The LinuxSolved.com GNU/Linux User Communit - Forum
Welcome to LinuxCommunity You have just arrived to a friendly linux community which is helping Linux Users from Years.. You can be its part if you have not already joined it. Registration is FREE and is gateway to unlimited help and support to all your linux related needs. If you are an GNU/Linux supporter then you have come to the right place.
Pages: [1]
  Print  
Author Topic: Please tell me about this  (Read 459 times)
0 Members and 1 Guest are viewing this topic.
vlinux1
Linux Learner
***
Offline Offline

Posts: 112


View Profile
« on: August 07, 2007, 03:33:54 AM »

Hello All,

I have a simple problem I have one file that contains some data that is old file  another file is new  and i want to copy some data ( 10000 lines) from old file to new without overwriting the new file. I don't want to disturb
new file.

Please tell me ..........

Thnaks in Advance

Vj 

Logged
rsw686
Linux Noob !
*
Offline Offline

Posts: 4


View Profile
« Reply #1 on: November 30, 2007, 02:19:42 PM »

How do you plan to copy data from the old to new file without disturbing the new file data? Are you trying to append the data. If so you could use

cat oldfile >> newfile

The >> signifies to append rather than replace.
Logged
gauravbajaj
LST CareTaker
Experienced
*****
Offline Offline

Posts: 597


View Profile
« Reply #2 on: December 07, 2007, 05:38:34 AM »

hi
 if you want to redirect a partial data, you can try these commands

head -1000 oldfile >> newfile

and if u want to extract data from a middle of file, you can try the ombination of head and tail or you can try below

sed '12,36!d' oldfile >> newfile

or

sed '12,36p' oldfile >> newfile

Above commands will extract the lines from 12 to 36 from oldfile and append it into new file
try both above commands  as  I am not very much sure about  which from above sed command runs , as i dont remember much , but you can give a try above

Thanks
Gaurav
« Last Edit: December 07, 2007, 05:44:36 AM by gauravbajaj » Logged
Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 09:46:38 PM

Login with username, password and session length
Navigation
Recent Discussions
[November 29, 2008, 02:23:49 PM]

[November 29, 2008, 02:14:14 PM]

[November 29, 2008, 04:00:36 AM]

[November 28, 2008, 07:05:28 AM]

[November 28, 2008, 07:04:39 AM]

[November 28, 2008, 06:58:16 AM]

[November 28, 2008, 06:47:09 AM]

[November 26, 2008, 11:53:32 AM]

[November 26, 2008, 04:00:22 AM]

[November 25, 2008, 06:44:47 PM]
Members
Total Members: 6252
Latest: rash31
Stats
Total Posts: 8285
Total Topics: 2257
Online Today: 34
Online Ever: 111
(June 28, 2007, 06:47:29 AM)
Users Online
Users: 0
Guests: 8
Total: 8
Privacy Policy| Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Theme & TinyPortal v0.9.8 © Bloc