10-13-2007
can you please give idea how you people are writing prog using sed and awk.
i tried several time and but failed.
please give me idea how start.
i read lot of stuff in sed and awk , even thu after seeing this i feel still i lag some where.
any help would be great full
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I have a excel file which has almost ten columns on the shared drive. I have to write a shell script to ftp that daily to unix server and then extract some columns from there and generate oracle standard text file. The columns should be in proper order and aligned properly, otherwise... (1 Reply)
Discussion started by: isingh786
1 Replies
2. Shell Programming and Scripting
FILE-1
USER username@foo.com
TOOLIN tool-a
TOOL2 tool-b
TOOL3 tool-c
TOOL4 tool-d
TOOL5 tool-e
USER username_2@foo.com
TOOLIN tool-e
TOOL2 tool-f
TOOL3 tool-c
TOOL4 tool-d
....
I need to take this file and generate a target XML file -
<access>
<managed>
... (3 Replies)
Discussion started by: jacki
3 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I want to create a file whose content is multiple lines of strings.
The string has the following pattern:
aaaa/bbbb/A-B.txt
A is a variable ranges from A1 to A2
B is a variable ranges from B1 to B2
Any ideas?
Thanks. (17 Replies)
Discussion started by: vic005
17 Replies
4. Shell Programming and Scripting
Hi,
I have the output (as below) which i want it to be in a table.
For e.g.
space utilization in PSE on path /logs is 0%
space utilization in PSE on path /logs/tuxedo/tuxlsp is 16%
space utilization in PSE on path /ldvarlsp/lsp/log is 37%
space utilization in PSE on path /home is 6%... (7 Replies)
Discussion started by: pkbond
7 Replies
5. Shell Programming and Scripting
Dear Members,
I have a table in Oracle DB and one of its column name is INFO which has data in text format which we need to fetch in a script and create an xml file of a new table from the input.
The contents of a single cell of INFO column is like:
Area:app - aam
Clean Up Criteria:... (0 Replies)
Discussion started by: Yoodit
0 Replies
6. Shell Programming and Scripting
hi,
i have a text file that looks like this!
i want to generate an excel sheet out of it, removing all the junk data except the addresses
that look like
. Arrow Electrical Services
Rotating Machinery, Electrical Contracting & Mining Specialists
Onsite maintenance, breakdown... (8 Replies)
Discussion started by: vemkiran
8 Replies
7. Shell Programming and Scripting
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies
8. Shell Programming and Scripting
Dear All
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies
9. Shell Programming and Scripting
Hi guys,
I have a text file that states:
cat prod.hosts
11.29.130.14 host1 host1.test.com web17
11.29.130.15 host2 host2.test.com web18
11.29.130.16 host3 host3.test.com web19
I want a .csv file that states:
... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies
10. UNIX for Beginners Questions & Answers
I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file.
Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies
LEARN ABOUT DEBIAN
file::fu
File::Fu(3pm) User Contributed Perl Documentation File::Fu(3pm)
NAME
File::Fu - file and directory objects
SYNOPSIS
The directory constructor:
use File::Fu;
my $dir = File::Fu->dir("bar");
print "$dir
"; # 'bar/'
my $file = $dir + 'bar.txt';
print "$file
"; # 'bar/bar.txt'
my $d2 = $dir % 'baz'; # 'barbaz/'
my $d3 = $dir / 'bat'; # 'bar/bat/'
my $file2 = $dir / 'bat' + 'foo.txt'; # 'bar/bat/foo.txt'
The file constructor:
my $file = File::Fu->file("foo");
$file->e and warn "$file exists";
$file->l and warn "$file is a link";
warn "file is in ", $file->dir;
ABOUT
This class provides the toplevel interface to File::Fu directory and file objects, with operator overloading which allows precise path
composition and support for most builtin methods, as well as creation of temporary files/directories, finding files, and more.
The interface and style are quite different than the perl builtins or File::Spec. The syntax is concise. Errors are thrown with croak(),
so you never need to check a return code.
Constructors
The actual objects are in the 'Dir' and 'File' sub-namespaces.
dir
my $dir = File::Fu->dir($path);
See "new" in File::Fu::Dir
file
my $file = File::Fu->file($path);
See "new" in File::Fu::File
Class Constants
tmp
Your system's '/tmp/' directory (or equivalent of that.)
my $dir = File::Fu->tmp;
home
User's $HOME directory.
my $dir = File::Fu->home;
program_name
The absolute name of your program. This will be relative from the time File::Fu was loaded. It dies if the name is '-e'.
my $prog = File::Fu->program_name;
If File::Fu was loaded after a chdir and the $0 was relative, calling program_name() throws an error. (Unless you set $0 correctly before
requiring File::Fu.)
program_dir
Returns what typically corresponds to program_name()->dirname, but just the compile-time cwd() when $0 is -e/-E.
my $dir = File::Fu->program_dir;
Class Methods
THIS_FILE
A nicer way to say __FILE__.
my $file = File::Fu->THIS_FILE;
cwd
The current working directory.
my $dir = File::Fu->cwd;
which
Returns File::Fu::File objects of ordered candidates for $name found in the path.
my @prog = File::Fu->which($name) or die "cannot find $name";
If called in scalar context, returns a single File::Fu::File object or throws an error if no candidates were found.
my $prog = File::Fu->which($name);
Temporary Directories and Files
These class methods call the corresponding File::Fu::Dir methods on the value of tmp(). That is, you get a temporary file/dir in the
'/tmp/' directory.
temp_dir
my $dir = File::Fu->temp_dir;
temp_file
my $handle = File::Fu->temp_file;
Subclassing
You may wish to subclass File:Fu and override the dir_class() and/or file_class() class methods to point to your own Dir/File subclasses.
my $class = 'My::FileFu';
my $dir = $class->dir("foo");
See File::Fu::File and File::Fu::Dir for more info.
See Also
File::Fu::why if I need to explain my motivations.
Path::Class, from which many an idea was taken.
File::stat, IO::File, File::Spec, File::Find, File::Temp, File::Path, File::Basename, perlfunc, perlopentut.
AUTHOR
Eric Wilhelm @ <ewilhelm at cpan dot org>
http://scratchcomputing.com/
BUGS
If you found this module on CPAN, please report any bugs or feature requests through the web interface at <http://rt.cpan.org>. I will be
notified, and then you'll automatically be notified of progress on your bug as I make changes.
If you pulled this development version from my /svn/, please contact me directly.
COPYRIGHT
Copyright (C) 2008 Eric L. Wilhelm, All Rights Reserved.
NO WARRANTY
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In
case of loss, no person or entity owes you anything whatsoever. You have been warned.
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-05-13 File::Fu(3pm)