07-23-2009
lathavim / pludi, thank you for your super-fast reply!
DukeNuke2 - apologies for not giving correct subject text!
lathavim / pludi - If I was running either of your commands manually it would work perfectly as I would be able to enter the name of the file I want to modify, however, remember my filename changes each month and I want to automate this.
Using either
sed -e '2,1d' file >file.tmp&&mv file.tmp file
or
perl -ni -e 'print if !/^\s*$/;' file.txt
requires me to enter the filename - but like I said, it changes each month and I want to automate the process. I need the script to actually fill in the filename for me. The file will always start with Myfile, and it will be the only file in the directory starting like this.
I had thought of using
ls Myfile* > nameholder
This creates a file called nameholder, within which is the name of the current months file to be modified.
If I could then somehow get the script to read that file and save the value as a parameter I could then use that parameter in the sed or perl command
sed -e '2,1d' $myfile >file.tmp&&mv file.tmp $myfile
Thanks for your excellent suggestions though.
Any thoughts?
6 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
Sorry Perderabo, really was only asking advice on where best to post, and if I should post.
Didn't intend for that missive to be posted. (0 Replies)
Discussion started by: keith.m
0 Replies
2. Post Here to Contact Site Administrators and Moderators
sorry, I recently posted twice, thinking it didn't go through. didn't mean to make you hassle with redundancy. thanks for your good work. (1 Reply)
Discussion started by: protienplant
1 Replies
3. UNIX for Dummies Questions & Answers
Hello everyone,
Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware.
I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies
4. Shell Programming and Scripting
Hello everyone,
I am having to do a lot of perl scripting these days and I am learning a lot.
I have this problem
I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files..
there is folder1\folder2\*.gz
and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies
5. Post Here to Contact Site Administrators and Moderators
Apologies about the earlier post, i didnt realise, could i delete that post? I apologise again,
SynGc (1 Reply)
Discussion started by: SynGc
1 Replies
6. Post Here to Contact Site Administrators and Moderators
In case you did not notice, our server was not available for about 10 hours this weekend. Our service provider (Servercraft) moved their entire data center from Houston to Dallas, TX.
They sent numerous emails to me but because of how I have configured gmail, none of the messages made... (0 Replies)
Discussion started by: Neo
0 Replies
LEARN ABOUT OSX
dbix::class::storage::dbi::oracle::wherejoins
DBIx::Class::Storage::DBI::Oracle::WhereJoins(3) User Contributed Perl Documentation DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)
NAME
DBIx::Class::Storage::DBI::Oracle::WhereJoins - Oracle joins in WHERE syntax support (instead of ANSI).
PURPOSE
This module is used with Oracle < 9.0 due to lack of support for standard ANSI join syntax.
SYNOPSIS
DBIx::Class should automagically detect Oracle and use this module with no work from you.
DESCRIPTION
This class implements Oracle's WhereJoin support. Instead of:
SELECT x FROM y JOIN z ON y.id = z.id
It will write:
SELECT x FROM y, z WHERE y.id = z.id
It should properly support left joins, and right joins. Full outer joins are not possible due to the fact that Oracle requires the entire
query be written to union the results of a left and right join, and by the time this module is called to create the where query and table
definition part of the SQL query, it's already too late.
METHODS
See DBIx::Class::SQLMaker::OracleJoins for implementation details.
BUGS
Does not support full outer joins. Probably lots more.
SEE ALSO
DBIx::Class::SQLMaker
DBIx::Class::SQLMaker::OracleJoins
DBIx::Class::Storage::DBI::Oracle::Generic
DBIx::Class
AUTHOR
Justin Wheeler "<jwheeler@datademons.com>"
CONTRIBUTORS
David Jack Olrik "<djo@cpan.org>"
LICENSE
This module is licensed under the same terms as Perl itself.
perl v5.16.2 2012-08-16 DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)