Sponsored Content
Top Forums Shell Programming and Scripting Removing the entire file contents using unix shell script. Post 302285940 by scorpio on Tuesday 10th of February 2009 02:02:44 AM
Old 02-10-2009
if u want to nullify the file use
:>filename
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix shell script to parse the contents of comma-separated file

Dear All, I have a comma-separated file. 1. The first line of the file(header) should have 4 commas(5 fields). 2. The last line of the file should have 1 comma(2 fields). Pls help me in checking this condition in a shell script. And the number of lines between the first line and last... (11 Replies)
Discussion started by: KrishnaSaran
11 Replies

2. Shell Programming and Scripting

update file contents using shell script

Hi, I am having a file which contains as below Names(aaaa ,bbbb ,cccc ,dddd) now i want the file to be updated with new value 'eeee' as below Names(aaaa ,bbbb ,cccc ,dddd ,eeee) Is there a way to script this ? Thanks, (5 Replies)
Discussion started by: drams
5 Replies

3. Shell Programming and Scripting

Remove spaces from first field, and write entire contents into other text file

Hi all, I have searched and found various threads about removing spaces from a field within a text file. Unfortunately, I have not found exactly what I'm looking for, nor am I adept enough to modify what I've found into what I need. I use the following command to remove the first line... (3 Replies)
Discussion started by: carriehoff
3 Replies

4. Shell Programming and Scripting

Shell script for converting file contents into CSV

Hi, I am new in unix, I just want to replace some values from text file according to column numbers. Like, I am having a table as given below: val1 val2 val3 val4 val5 val6 val7 val8 val9 val10 val11 val12 val13 Now i want... (5 Replies)
Discussion started by: rish_max
5 Replies

5. Shell Programming and Scripting

shell script to compare file contents

Hello Has anyone got an example shell script that I can use to compare the contents of two files. The files should contain the same contents, eg. file1.txt apple pear grape file2.txt apple pear grape (2 Replies)
Discussion started by: deedaz
2 Replies

6. UNIX for Dummies Questions & Answers

Copy entire contents of file to clipboard

Hi, I am trying to figure out how to copy the contents of a file to the clipboard, then paste into a command. i.e copy contents of file /path/filename.txt to <command> <paste text> Hope that makes sense. Basically tryting to copy the text for use in a command without having to open the... (8 Replies)
Discussion started by: JCA70
8 Replies

7. Shell Programming and Scripting

Subsituting contents of entire file to middle of another file using awk

Hi I have a data file 'File2' consisting of 105670 lines. I want to copy and paste 17928 lines from 'File1' to 'File2' but I want to place it in between lines 21 and 17950 of 'File2'. How do I do it in awk? For example- File A has 5 lines X Y 1 2 3 4 5 6 7 8 9 and File B has A b... (1 Reply)
Discussion started by: ananyob
1 Replies

8. Shell Programming and Scripting

Subsituting contents of entire file to middle of another file using awk

Hi I have a data file 'File2' consisting of 105670 lines. I want to copy and paste 17928 lines from 'File1' to 'File2' but I want to place it in between lines 21 and 17950 of 'File2'. How do I do it in awk? For example- File A has 5 lines X Y 1 2 3 4 5 6 7 8 9 and File B has A b... (1 Reply)
Discussion started by: ananyob
1 Replies

9. Shell Programming and Scripting

Modifying contents of the file in shell script

Hello all, I have a Kconfig file that looks like something below ... ================================ menu "Application type" config GUI_TYPE_STANDARD bool "Standard Application" source "cfg/config/std.in" source... (12 Replies)
Discussion started by: anand.shah
12 Replies

10. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
QSqlField(3qt)															    QSqlField(3qt)

NAME
QSqlField - Manipulates the fields in SQL database tables and views SYNOPSIS
#include <qsqlfield.h> Public Members QSqlField ( const QString & fieldName = QString::null, QVariant::Type type = QVariant::Invalid ) QSqlField ( const QSqlField & other ) QSqlField & operator= ( const QSqlField & other ) bool operator== ( const QSqlField & other ) const virtual ~QSqlField () virtual void setValue ( const QVariant & value ) virtual QVariant value () const virtual void setName ( const QString & name ) QString name () const virtual void setNull () bool isNull () const virtual void setReadOnly ( bool readOnly ) bool isReadOnly () const void clear ( bool nullify = TRUE ) QVariant::Type type () const DESCRIPTION
The QSqlField class manipulates the fields in SQL database tables and views. QSqlField represents the characteristics of a single column in a database table or view, such as the data type and column name. A field also contains the value of the database column, which can be viewed or changed. Field data values are stored as QVariants. Using an incompatible type is not permitted. For example: QSqlField f( "myfield", QVariant::Int ); f.setValue( QPixmap() ); // will not work However, the field will attempt to cast certain data types to the field data type where possible: QSqlField f( "myfield", QVariant::Int ); f.setValue( QString("123") ); // casts QString to int QSqlField objects are rarely created explicitly in application code. They are usually accessed indirectly through QSqlRecord or QSqlCursor which already contain a list of fields. For example: QSqlCursor cur( "Employee" ); // create cursor using the 'Employee' table QSqlField* f = cur.field( "name" ); // use the 'name' field f->setValue( "Dave" ); // set field value ... In practice we rarely need to extract a pointer to a field at all. The previous example would normally be written: QSqlCursor cur( "Employee" ); cur.setValue( "name", "Dave" ); ... See also Database Classes. MEMBER FUNCTION DOCUMENTATION
QSqlField::QSqlField ( const QString & fieldName = QString::null, QVariant::Type type = QVariant::Invalid ) Constructs an empty field called fieldName of type type. QSqlField::QSqlField ( const QSqlField & other ) Constructs a copy of other. QSqlField::~QSqlField () [virtual] Destroys the object and frees any allocated resources. void QSqlField::clear ( bool nullify = TRUE ) Clears the value of the field. If the field is read-only, nothing happens. If nullify is TRUE (the default), the field is set to NULL. bool QSqlField::isNull () const Returns TRUE if the field is currently NULL; otherwise returns FALSE. bool QSqlField::isReadOnly () const Returns TRUE if the field's value is read only; otherwise returns FALSE. QString QSqlField::name () const Returns the name of the field. Example: sql/overview/table4/main.cpp. QSqlField &; QSqlField::operator= ( const QSqlField & other ) Sets the field equal to other. bool QSqlField::operator== ( const QSqlField & other ) const Returns TRUE if the field is equal to other; otherwise returns FALSE. Fields are considered equal when the following field properties are the same: name() isNull() value() isReadOnly() void QSqlField::setName ( const QString & name ) [virtual] Sets the name of the field to name. void QSqlField::setNull () [virtual] Sets the field to NULL and clears the value using clear(). If the field is read-only, nothing happens. See also isReadOnly() and clear(). void QSqlField::setReadOnly ( bool readOnly ) [virtual] Sets the read only flag of the field's value to readOnly. See also setValue(). void QSqlField::setValue ( const QVariant & value ) [virtual] Sets the value of the field to value. If the field is read-only (isReadOnly() returns TRUE), nothing happens. If the data type of value differs from the field's current data type, an attempt is made to cast it to the proper type. This preserves the data type of the field in the case of assignment, e.g. a QString to an integer data type. For example: QSqlCursor cur( "Employee" ); // 'Employee' table QSqlField* f = cur.field( "student_count" ); // an integer field ... f->setValue( myLineEdit->text() ); // cast the line edit text to an integer See also isReadOnly(). QVariant::Type QSqlField::type () const Returns the field's type. QVariant QSqlField::value () const [virtual] Returns the value of the field as a QVariant. Example: sql/overview/table4/main.cpp. SEE ALSO
http://doc.trolltech.com/qsqlfield.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qsqlfield.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QSqlField(3qt)
All times are GMT -4. The time now is 06:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy