Sponsored Content
Full Discussion: Apologies from a newbie!
Top Forums UNIX for Dummies Questions & Answers Apologies from a newbie! Post 302336873 by speedfreak on Thursday 23rd of July 2009 04:00:12 AM
Old 07-23-2009
Apologies from a newbie!

Apologies because this may have been covered elsewhere, but I DID search but couldn't find exactly what I was looking for.

My problem is as follows....

I'm doing an extract from an Oracle database, my SQL script does some date manipulation and creates the output file with some date details in the title. For example, this month the file will be called MyfileJuly09.txt, next month it will be created as MyfileAugust09, etc...

This file is then to be ftpd onto another server, and I want to automate all of this.

Due to the nature of the SQL statements in my script, my text file has a blank line between the header and data. i.e.

Member No Policy No

1 000000001
2 000000032

What I want to do is to remove the blank line so the file looks like this...

Member No Policy No
1 000000001
2 000000032

It's only this one line I want to remove. I can't remove it in the SQL script itself - all to do with concatenating columns together etc...)

I know I can use sed or perl to remove the blank line, but my problem is that I want to retain the file name!

If I use sed - sed '2,1d' inputfile > outputfile - I need to specify the inputfile name (but that changes each month) and sed wants to create a new output file, but I want to keep the original filename

How can I have a script pick up the correct file, remove the blank line and then save the file with it's original name.

If it helps, there will only ever be one file (the one just created) in the current directory with a name like - Myfile.......

Any help would be greatly appreciated.
 

6 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

apologies to Perderabo

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

apologies

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

UNIX newbie NEWBIE question!

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

perl newbie . &&..programming newbie (question 2)

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

Help with deleting post, apologies about the earlier post.

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

Our Apologies for the Down Time This Weekend (Servercraft Migration)

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
SQL::ReservedWords::Oracle(3pm) 			User Contributed Perl Documentation			   SQL::ReservedWords::Oracle(3pm)

NAME
SQL::ReservedWords::Oracle - Reserved SQL words by Oracle SYNOPSIS
if ( SQL::ReservedWords::Oracle->is_reserved( $word ) ) { print "$word is a reserved Oracle word!"; } DESCRIPTION
Determine if words are reserved by Oracle Database. METHODS
is_reserved( $word ) Returns a boolean indicating if $word is reserved by either Oracle7, Oracle8i, Oracle9i or Oracle10g. is_reserved_by_oracle7( $word ) Returns a boolean indicating if $word is reserved by Oracle7. is_reserved_by_oracle8( $word ) Returns a boolean indicating if $word is reserved by Oracle8i. is_reserved_by_oracle9( $word ) Returns a boolean indicating if $word is reserved by Oracle9i. is_reserved_by_oracle10( $word ) Returns a boolean indicating if $word is reserved by Oracle10g. reserved_by( $word ) Returns a list with Oracle versions that reserves $word. words Returns a list with all reserved words. EXPORTS
Nothing by default. Following subroutines can be exported: is_reserved is_reserved_by_oracle7 is_reserved_by_oracle8 is_reserved_by_oracle9 is_reserved_by_oracle10 reserved_by words SEE ALSO
SQL::ReservedWords <http://www.oracle.com/technology/documentation/> AUTHOR
Christian Hansen "chansen@cpan.org" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2008-03-28 SQL::ReservedWords::Oracle(3pm)
All times are GMT -4. The time now is 05:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy