LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 09-25-2012, 06:12 PM   #1
frinks
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
How to Copy text from file set & place text into another file.


Hi,
this thread is old but i'm having the same problem with some differences.
I have hundreds of files, that are the output of a program and i need that information in only one file.
The file that are the output of a program have text information from the lines 2 to 48.
I need to copy this text from all the files to another.
Example:
Inside file1:
line1:"#$$&%/$57477$%&$"&%"
line2:this is a variable1=1
line3:this is a variable2=3
...
line48:this is other variable48=22
line49:"!#!"#!"#!"#

Inside file2:
line1:"#$$&%/$57477$%&$"&%"
line2:this is a variable1=1
line3:this is a variable2=3
...
line48:this is other variable48=22
line49:"!#!"#!"#!"#

And i need an output called newfile like:
file1
line2:this is a variable1=1
line3:this is a variable2=3
...
line48:this is other variable48=22

file2:
line2:this is a variable1=1
line3:this is a variable2=3
...
line48:this is other variable48=22

Is it possible?
Need some help to do this if possible.
 
Old 09-26-2012, 08:59 AM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,922
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Moderator Response

Hi,

Welcome to LQ!

Please do not hijack threads. You posted to a old thread with no real contribution to that thread. You should have created a new thread. Your post has been moved to a new thread.

Please review the LQ Rules.

You might find the following useful;
FYI: I suggest that you look at 'How to Ask Questions the Smart Way' so in the future your queries provide information that will aid us in diagnosis of the problem or query.

Just a few links to aid you to gaining some understanding to help you to solve the problem(s);



1 Linux Documentation Project
2 Rute Tutorial & Exposition
3 Linux Command Guide
4 Bash Beginners Guide
5 Bash Reference Manual
6 Advanced Bash-Scripting Guide
7 Linux Newbie Admin Guide
8 LinuxSelfHelp
9 Utimate Linux Newbie Guide
10 Linux Home Networking
11 Virtualization- Top 10

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 09-26-2012, 10:59 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://www.thegeekstuff.com/2009/09/...-and-patterns/
 
  


Reply


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
[SOLVED] Bash command to 'cut' text into another text file & modifying text. velgasius Programming 4 10-17-2011 04:55 AM
[SOLVED] Script to copy paste text from one file to another (overwriting part of the file) freet Programming 4 04-19-2011 03:23 PM
copy last 10000+ lines of large text file to a temporary file emilyg Linux - Newbie 3 06-24-2009 02:43 PM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 02:36 PM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:53 AM.

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