Sponsored Content
Top Forums Shell Programming and Scripting ShellScript to Remove Newline in ouput.csv Post 302749019 by rdrtx1 on Thursday 27th of December 2012 10:05:42 AM
Old 12-27-2012
try also:
Code:
awk '$1=$1' RS= infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to remove all tabs and newline (\n)

how to remove all tabs and newline (\n) from the exicting file (2 Replies)
Discussion started by: pvr_satya
2 Replies

2. Shell Programming and Scripting

Remove newline character conditionally

Hi All, I have 5000 records like this Request_id|Type|Status|Priority|Ticket Submitted Date and Time|Actual Resolved Date and Time|Current Ticket Owner Group|Case final Ticket Owner Group|Customer Severity|Reported Symptom/Request|Component|Hot Topic|Reason for Missed SLA|Current Ticket... (2 Replies)
Discussion started by: j_53933
2 Replies

3. Shell Programming and Scripting

sed/awk remove newline

Hi, I have input file contains sql queries i need to eliminate newlines from it. when i open it vi text editor and runs :%s/'\n/'/g it provides required result. but when i run sed command from shell prompt it doesn't impact outfile is still same as inputfile. shell] sed -e... (6 Replies)
Discussion started by: mirfan
6 Replies

4. Shell Programming and Scripting

remove newline between two string with sed command in unix shellscript

I have a file (test.dat) which contains data like this 459|199811047|a |b |shan kar|ooty| 460|199811047|a |bv |gur u|cbe| but I need it like: 459|199811047|a |b |shankar|ooty| 460|199811047|a |b |guru|cbe| While reading the data from this file, I don't want to remove newline from the end of... (4 Replies)
Discussion started by: jcrshankar
4 Replies

5. Shell Programming and Scripting

Create an .csv/excel file using shellscript

In my file, i have 4 Product names(For ex:Microsoft excel, Oracle,.Net,IBM websphere,..etc.,) I want this 4 Products in 4 individual .csv/excel file after running the script with those products related information. (12 Replies)
Discussion started by: Navya
12 Replies

6. Shell Programming and Scripting

remove ] followed by newline in bash

I need to remove ] followed by newline character to convert lines like: line1] line2 into: line1line2 (4 Replies)
Discussion started by: locoroco
4 Replies

7. Shell Programming and Scripting

Remove newline character between two delimiters

hi i am having delimited .dat file having content like below. test.dat(5 line of records) ====== PT2~Stag~Pt2 Stag Test. Updated~PT2 S T~Area~~UNCEF R20~~2012-05-24 ~2014-05-24~~ PT2~Stag y~Pt2 Stag Test. Updated~PT2 S T~Area~METR~~~2012-05-24~2014-05-24~~test PT2~Pt2 Stag Test~~PT2 S... (4 Replies)
Discussion started by: sushine11
4 Replies

8. Linux

Remove newline in middle of string

my file input is with tab as delimiter, and in every line, there would be a skip of line with an unexcepted newline breaker. I'd like to remove this \n and put the information in the same line. INPUT a1 b1b2 c1 c2 d1 a2 b3 c3 d4 OUTPUT a1 b1b2 c1c2 ... (9 Replies)
Discussion started by: kinkichin
9 Replies

9. Shell Programming and Scripting

Remove last newline character..

Hi all.. I have a text file which looks like below: abcd efgh ijkl (blank space) I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file. I have tried options like... (14 Replies)
Discussion started by: Sathya83aa
14 Replies

10. Shell Programming and Scripting

Shellscript command to remove files starting with a certain string, and older than 3 days

Hi All, Need help in identifying a shellscript command to remove all files on a server directory, starting with a certain prefix and also older than 3 days. That means files created with that prefix, today or yesterday, shouldn't be removed. Thanks, Dev (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
Alzabo::SQLMaker(3pm)					User Contributed Perl Documentation				     Alzabo::SQLMaker(3pm)

NAME
Alzabo::SQLMaker - Alzabo base class for RDBMS drivers SYNOPSIS
use Alzabo::SQLMaker::MySQL; my $sql = Alzabo::SQLMaker::MySQL->new( driver => $driver_object ); # or better yet my $sql = $runtime_schema->sqlmaker; DESCRIPTION
This is the base class for all Alzabo::SQLMaker modules. To instantiate a driver call this class's "new" method. See "SUBCLASSING Alz- abo::SQLMaker" for information on how to make a driver for the RDBMS of your choice. METHODS
available Returns A list of names representing the available "Alzabo::SQLMaker" subclasses. Any one of these names would be appropriate as a parame- ter for the "Alzabo::SQLMaker->load()" method. load Load the specified subclass. This takes one parameter, the name of the RDBMS being used. Throws: "Alzabo::Exception::Eval" new This takes two parameters: * driver The driver object being used by the schema. * quote_identifiers A boolean value indicating whether or not identifiers should be quoted. This defaults to false. GENERATING SQL
This class can be used to generate SQL by calling methods that are the same as those used in SQL ("select()", "update()", etc.) in sequence, with the appropriate parameters. There are four entry point methods, "select()", "insert()", "update()", and "delete()". Attempting to call any other method without first calling one of these is an error. Entry Points These methods are called as class methods and return a new object. select ("Alzabo::Table" and/or "Alzabo::Column" objects) This begins a select. The columns to be selected are the column(s) passed in, and/or the columns of the table(s) passed in as arguments. Followed by: "from()" "** function" insert Followed by: "into()" update ("Alzabo::Table") Followed by: "set()" delete Followed by: "from()" Other Methods All of these methods return the object itself, making it possible to chain together method calls such as: Alzabo::SQLMaker->select($column)->from($table)->where($other_column, '>', 2); from ("Alzabo::Table" object, ...) The table(s) from which we are selecting data. Follows: "select()" "** function" "delete()" Followed by: "where()""> "order_by()" Throws: "Alzabo::Exception::SQL" where <see below> The first parameter to where must be an "Alzabo::Column" object or SQL function. The second is a comparison operator of some sort, given as a string. The third argument can be an "Alzabo::Column" object, a value (a number or string), or an "Alzabo::SQLMaker" object. The latter is treated as a subselect. Values given as parameters will be properly quoted and escaped. Some comparison operators allow additional parameters. The "BETWEEN" comparison operator requires a fourth argument. This must be either an "Alzabo::Column" object or a value. The "IN" and <NOT IN> operators allow any number of additional parameters, which may be "Alzabo::Column" objects, values, or "Alzabo::SQL- Maker" objects. Follows: "from()" Followed by: "and()" "or()" "order_by()" Throws: "Alzabo::Exception::SQL" and (same as "where") or (same as "where") These methods take the same parameters as the "where()""> method. Follows: "where()""> "and()" "or()" Followed by: "and()" "or()" "order_by()" Throws: "Alzabo::Exception::SQL" order_by ("Alzabo::Column" objects) Adds an "ORDER BY" clause to your SQL. Follows: "from()" "where()""> "and()" "or()" Followed by: "limit()" Throws: "Alzabo::Exception::SQL" limit ($max, optional $offset) Specifies a limit on the number of rows to be returned. The offset parameter is optional. Follows: "from()" "where()""> "and()" "or()" "order_by()" "Alzabo::Exception::SQL" into ("Alzabo::Table" object, optional "Alzabo::Column" objects) Used to specify what table an insert is into. If column objects are given then it is expected that values will only be given for that object. Otherwise, it assumed that all columns will be specified in the "values()" method. Follows: "insert()" Followed by: "values()" Throws: "Alzabo::Exception::SQL" values ("Alzabo::Column" object => $value, ...) This method expects to recive an structured like a hash where the keys are "Alzabo::Column" objects and the values are the value to be inserted into that column. Follows: "into()" Throws: "Alzabo::Exception::SQL" set ("Alzabo::Column" object => $value, ...) This method'a parameter are exactly like those given to the "values" method. Follows: "update()" Followed by: "where()""> Throws: "Alzabo::Exception::SQL" RETRIEVING SQL FROM THE OBJECT
sql This method can be called at any time, though obviously it will not return valid SQL unless called at a natural end point. In the future, an exception may be thrown if called when the SQL is not in a valid state. Returns the SQL generated so far as a string. bind Returns an array reference containing the parameters to be bound to the SQL statement. SUBCLASSING Alzabo::SQLMaker To create a subclass of "Alzabo::SQLMaker" for your particular RDBMS requires only that the virtual methods listed below be implemented. In addition, you may choose to override any of the other methods described in this documentation. For example, the MySQL subclass override the "_subselect()" method because MySQL cannot support sub-selects. Subclasses are also expected to offer for export various sets of functions matching SQL functions. See the "Alzabo::SQLMaker::MySQL" sub- class implementation for details. VIRTUAL METHODS
The following methods must be implemented by the subclass: limit See above for the definition of this method. get_limit This method may return "undef" even if the "limit()" method was called. Some RDBMS's have special SQL syntax for "LIMIT" clauses. For those that don't support this, the "Alzabo::Driver" module takes a "limit" parameter. The return value of this method can be passed in as that parameter. If the RDBMS does not support "LIMIT" clauses, the return value is an array reference containing two values, the maximum number of rows allowed and the row offset (the first row that should be used). If the RDBMS does support "LIMIT" clauses, then the return value is "undef". sqlmaker_id Returns the subclass's name. This should be something that can be passed to "Alzabo::SQLMaker->load()" as a parameter. AUTHOR
Dave Rolsky, <dave@urth.org> perl v5.8.8 2007-12-23 Alzabo::SQLMaker(3pm)
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy