Sponsored Content
Top Forums Shell Programming and Scripting Shell :copying the content from one file to another Post 302757855 by giridhar276 on Friday 18th of January 2013 06:02:03 AM
Old 01-18-2013
Shell :copying the content from one file to another

I have a log containing the below lines.
file1.log
-----------
Code:
module: 
module1
module10
module2
module002
module9
moduleRT100.2.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
moduleRT100.3.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

file2.log
Code:
module1
module10
module2
module002
module9

Now file2 has to be generated from file1 by eliminating all module: and moduleRT etc. Only module that are postfixed with number has to be copied to file2.log

Could anyone please help me in this regard
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

copying content of a file

Hi, I have a file in my unix system let's call it FileName. First I want to copy its content into a another file, but outside of the unix, meaning I could open it at home. (text file would be perfect) Second (if it's possible) I need to take the first word of each line in the file (you know... (2 Replies)
Discussion started by: talzohar
2 Replies

2. Shell Programming and Scripting

Copying selected content from file

I want to capture contents of a file between 2 strings into another file for eg all lines in between the keywords "start log" and "end log" should be copied into another file (1 Reply)
Discussion started by: misenkiser
1 Replies

3. UNIX for Dummies Questions & Answers

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive . what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me with the command and the... (0 Replies)
Discussion started by: skamal4u
0 Replies

4. Solaris

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive which has higher capacity. what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me... (1 Reply)
Discussion started by: skamal4u
1 Replies

5. Shell Programming and Scripting

Copying Information from One File to Another File in Shell

Hello, I'm new to scripting and I need help moving text from one file to another file. Here are examples what the files look like. File 1: Ac-223 2.10m A 1 0 0 0 Fr-219 358 9.9000E-01 0 0.0 0 0.0 0 0.0... (1 Reply)
Discussion started by: tamachan414
1 Replies

6. Shell Programming and Scripting

To tar the content while copying files

Any idea on how we can tar the content while copying the files from one location to another location using the bash script. (2 Replies)
Discussion started by: gsiva
2 Replies

7. Shell Programming and Scripting

Copying lines from multiple logfiles, based on content of the line

d df d d (1 Reply)
Discussion started by: larsk
1 Replies

8. Shell Programming and Scripting

Copying a string from a file using shell script

Hello everyone I am completely new to shell scripting in linux. I wan to write a script to search for a certain string from a .txt file and copy the string which apears just after tat searched string. Eg: in a file- try.txt , we have a line saying: "roses are red, so what do i do" I... (4 Replies)
Discussion started by: Kishore920
4 Replies

9. Shell Programming and Scripting

Shell Script for copying text file to Excel Sheet

Hi, I want to write a program to copy a log file to Excel sheet. Excel sheet has four columns MethodName , Code , Description, Details and Time. I want to pick these info from text file and put it in excel sheet. here is how the text file looks - 04.17.2014 08:06:12,697... (1 Reply)
Discussion started by: hershey
1 Replies
CPANPLUS::Shell::Default::Plugins::Source(3pm)		 Perl Programmers Reference Guide	    CPANPLUS::Shell::Default::Plugins::Source(3pm)

NAME
CPANPLUS::Shell::Default::Plugins::Source - read in CPANPLUS commands SYNOPSIS
CPAN Terminal> /source /tmp/list_of_commands /tmp/more_commands DESCRIPTION
This is a "CPANPLUS::Shell::Default" plugin that works just like your unix shells source(1) command; it reads in a file that has commands in it to execute, and then executes them. A sample file might look like this: # first, update all the source files x --update_source # find all of my modules that are on the CPAN # test them, and store the error log a ^KANE$' t * p /home/kane/cpan-autotest/log # and inform us we're good to go ! print "Autotest complete, log stored; please enter your commands!" Note how empty lines, and lines starting with a '#' are being skipped in the execution. BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>. AUTHOR
This module by Jos Boumans <kane@cpan.org>. COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved. This library is free software; you may redistribute and/or modify it under the same terms as Perl itself. SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::Shell, cpanp perl v5.16.2 2012-10-11 CPANPLUS::Shell::Default::Plugins::Source(3pm)
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy