Sponsored Content
Top Forums UNIX for Advanced & Expert Users Insert Delimiter at fixed locations in a flat file Post 302429520 by ygemici on Monday 14th of June 2010 05:01:27 PM
Old 06-14-2010
You may be forget one backslash Smilie

Code:
# sed "s/^\(..\)\(...\)/\1;2;/" file
{
kk;2;hal
sd;2;ss
sd;2;eetyw
}

Code:
# sed "s/^\(..\)\(...\)/\1;\2;/" file
{
kk;jhd;hal
sd;few;ss
sd;ter;eetyw
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

adding delimiter to a fixed width file

Hi , I have a file : CSCH74000.00 CSCH74000.00 CSCH74100.00 CSCH74000.00 CSCH74100.00 CSCH74000.00 CSCH74000.00 CSCH74100.00 CSCH74100.00 CSCH74100.00 I have to put a delimiter( say comma) in between after 6th character: CSCH74,000.00 CSCH74,000.00 CSCH74,100.00 (2 Replies)
Discussion started by: sumeet
2 Replies

2. Shell Programming and Scripting

How to insert at a particular position in flat file

Hi All, I have a flat file with ~ as de-limiter (e.g: aaa~ba a~caa~0~d~e) What I want is check if the 4th character is 0 and replace it with say 4. So now it becomes : aaa~ba a~caa~4~d~e. I have to do this for the whole file, but the delimiter position remains the same, not the... (10 Replies)
Discussion started by: akdwivedi
10 Replies

3. UNIX for Dummies Questions & Answers

Conditional sorting on fixed length flat file

I have a fixed length file that need to be sorted according to the following rule IF B=1 ORDER by A,B Else ORDER by A,C Input file is ABC 131 112 122 231 212 222 Output needed ABC 112 131 122 212 231 222 (1 Reply)
Discussion started by: zsk_00
1 Replies

4. Shell Programming and Scripting

Exporting a flat fixed length file (Urgent)

Hi All, So far, I've been extracting data from db2 tables and exporting the file as a tab delimited file into a UNIX server using the following command: export to /.../.../.../.../.../SM_RAW_DATA.dat of del modified by coldel| nochardel select a.accno, a.CUR_BL_AM, ... (1 Reply)
Discussion started by: jj2485
1 Replies

5. Shell Programming and Scripting

how to read fixed length flat file....

Hi Gurus, Thanks in advance... I am new to writing shell scripting and help me out reading a flat file with fixed length. I have a fixed length flat file with storename(lenth 6) , emailaddress(lenth 15), location(10). There is NO delimiters in that file. Like the following str00001.txt... (2 Replies)
Discussion started by: willywilly
2 Replies

6. Shell Programming and Scripting

reading fixed length flat file and calling java code using shell scripting

I am new to shell scripting and I have to to the following I have a flat file with storename(lenth 20) , emailaddress(lenth 40), location(15). There is NO delimiters in that file. Like the following str00001.txt StoreName emailaddress location... (3 Replies)
Discussion started by: willywilly
3 Replies

7. Shell Programming and Scripting

How to read the first column in a flat file with ~ as delimiter

I have one flat file like below id1~col~batch1 id2~col2~batch2 id3~col3~batch3 I need to read the first column one by one and I need to write one db2 query based on that column1 Like for (i=0;i<=10;i++) do insert into table column (con_id) values (select column from table where... (4 Replies)
Discussion started by: siri_886
4 Replies

8. Shell Programming and Scripting

Program to insert Delimiters at fixed locations in a file, Can you please Debug it for me??

Can someone please help?I have a file - fixed.txt----------------------------AABBBBCCCCCCDDDEEFFFFGGGGGGHHHIIJJJJKKKKKKLLL----------------------------To insert delimiters at fixed lengths of 2, 4, 6, 3, I created a file text1.txt as-------------------2463----------------------and trying to execute... (10 Replies)
Discussion started by: jd_mca
10 Replies

9. Shell Programming and Scripting

how to implement in one-line awk in a fixed file having no delimiter

Hi, I have a file a.txt having no delimiter. I want to exclude the line which contains 435th character as 1 or 2 and redirect the rest of the lines to another file b. Can you pls suggest how to do this in one liner awk. Following is just one line of the input file a:- 120110116 ... (10 Replies)
Discussion started by: millan
10 Replies

10. Shell Programming and Scripting

Fixed length flat file extraction

Hii ,I am new to Unix ,i have a flat file which is (fixed length) sitting in unix,Which is holding the data for a table.I want to extract one column(length7-10) on the basis of another column(length13-15) and want only one single row Example: Below is the sample of flat file. 1111 AAAA 100 ... (4 Replies)
Discussion started by: laxmi1166
4 Replies
QGroupBox(3qt)															    QGroupBox(3qt)

NAME
QGroupBox - Group box frame with a title SYNOPSIS
#include <qgroupbox.h> Inherits QFrame. Inherited by QButtonGroup, QHGroupBox, and QVGroupBox. Public Members QGroupBox ( QWidget * parent = 0, const char * name = 0 ) QGroupBox ( const QString & title, QWidget * parent = 0, const char * name = 0 ) QGroupBox ( int strips, Orientation orientation, QWidget * parent = 0, const char * name = 0 ) QGroupBox ( int strips, Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 ) virtual void setColumnLayout ( int strips, Orientation direction ) QString title () const virtual void setTitle ( const QString & ) int alignment () const virtual void setAlignment ( int ) int columns () const void setColumns ( int ) Orientation orientation () const void setOrientation ( Orientation ) int insideMargin () const int insideSpacing () const void setInsideMargin ( int m ) void setInsideSpacing ( int s ) void addSpace ( int size ) bool isFlat () const void setFlat ( bool b ) Properties Alignment alignment - the alignment of the group box title int columns - the number of columns or rows (depending on QGroupBox::orientation) in the group box bool flat - whether the group box is painted flat or has a frame around it Orientation orientation - the current orientation of the group box QString title - the group box title text DESCRIPTION
The QGroupBox widget provides a group box frame with a title. A group box provides a frame, a title and a keyboard shortcut, and displays various other widgets inside itself. The title is on top, the keyboard shortcut moves keyboard focus to one of the group box's child widgets, and the child widgets are arranged in an array inside the frame. The simplest way to use it is to create a group box with the desired number of columns (or rows) and orientation, and then just create widgets with the group box as parent. However, it is also possible to change the orientation() and number of columns() after construction, or to ignore all the automatic layout support and manage all that yourself. You can add 'empty' spaces to the group box with addSpace(). QGroupBox also lets you set the title() (normally set in the constructor) and the title's alignment(). You can change the spacing used by the group box with setInsideMargin() and setInsideSpacing(). To reduce space consumption, you can remove the right, left and bottom edges of the frame with setFlat(). [Image Omitted] See also QButtonGroup, Widget Appearance and Style, Layout Management, and Organizers. MEMBER FUNCTION DOCUMENTATION
QGroupBox::QGroupBox ( QWidget * parent = 0, const char * name = 0 ) Constructs a group box widget with no title. The parent and name arguments are passed to the QWidget constructor. This constructor does not do automatic layout. QGroupBox::QGroupBox ( const QString & title, QWidget * parent = 0, const char * name = 0 ) Constructs a group box with the title title. The parent and name arguments are passed to the QWidget constructor. This constructor does not do automatic layout. QGroupBox::QGroupBox ( int strips, Orientation orientation, QWidget * parent = 0, const char * name = 0 ) Constructs a group box with no title. Child widgets will be arranged in strips rows or columns (depending on orientation). The parent and name arguments are passed to the QWidget constructor. QGroupBox::QGroupBox ( int strips, Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 ) Constructs a group box titled title. Child widgets will be arranged in strips rows or columns (depending on orientation). The parent and name arguments are passed to the QWidget constructor. void QGroupBox::addSpace ( int size ) Adds an empty cell at the next free position. If size is greater than 0, the empty cell has a fixed height or width. If the group box is oriented horizontally, the empty cell has a fixed height; if oriented vertically, it has a fixed width. Use this method to separate the widgets in the group box or to skip the next free cell. For performance reasons, call this method after calling setColumnLayout() or by changing the QGroupBox::columns or QGroupBox::orientation properties. It is generally a good idea to call these methods first (if needed at all), and insert the widgets and spaces afterwards. int QGroupBox::alignment () const Returns the alignment of the group box title. See the "alignment" property for details. int QGroupBox::columns () const Returns the number of columns or rows (depending on QGroupBox::orientation) in the group box. See the "columns" property for details. int QGroupBox::insideMargin () const Returns the width of the blank spacing between the items in the group and the frame of the group. Only applies if the group box has a defined orientation. The default is about 11. See also setInsideMargin() and orientation. int QGroupBox::insideSpacing () const Returns the width of the blank spacing between each of the items in the group. Only applies if the group box has a defined orientation. The default is about 5. See also setInsideSpacing() and orientation. bool QGroupBox::isFlat () const Returns TRUE if the group box is painted flat or has a frame around it; otherwise returns FALSE. See the "flat" property for details. Orientation QGroupBox::orientation () const Returns the current orientation of the group box. See the "orientation" property for details. void QGroupBox::setAlignment ( int ) [virtual] Sets the alignment of the group box title. See the "alignment" property for details. void QGroupBox::setColumnLayout ( int strips, Orientation direction ) [virtual] Changes the layout of the group box. This function is useful only in combination with the default constructor that does not take any layout information. This function will put all existing children in the new layout. It is not good Qt programming style to call this function after children have been inserted. Sets the number of columns or rows to be strips, depending on direction. See also orientation and columns. Example: chart/optionsform.cpp. void QGroupBox::setColumns ( int ) Sets the number of columns or rows (depending on QGroupBox::orientation) in the group box. See the "columns" property for details. void QGroupBox::setFlat ( bool b ) Sets whether the group box is painted flat or has a frame around it to b. See the "flat" property for details. void QGroupBox::setInsideMargin ( int m ) Sets the the width of the blank spacing between each of the items in the group to m pixels. See also insideSpacing(). void QGroupBox::setInsideSpacing ( int s ) Sets the width of the blank spacing between each of the items in the group to s pixels. void QGroupBox::setOrientation ( Orientation ) Sets the current orientation of the group box. See the "orientation" property for details. void QGroupBox::setTitle ( const QString & ) [virtual] Sets the group box title text. See the "title" property for details. QString QGroupBox::title () const Returns the group box title text. See the "title" property for details. Property Documentation Alignment alignment This property holds the alignment of the group box title. The title is always placed on the upper frame line; however, the horizontal alignment can be specified by the alignment parameter. The alignment is one of the following flags: AlignAuto aligns the title accroding to the language, usually left. AlignLeft aligns the title text to the left. AlignRight aligns the title text to the right. AlignHCenter aligns the title text centered. The default alignment is AlignAuto. See also Qt::AlignmentFlags. Set this property's value with setAlignment() and get this property's value with alignment(). int columns This property holds the number of columns or rows (depending on QGroupBox::orientation) in the group box. Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is better to set the number of columns directly in the constructor. Set this property's value with setColumns() and get this property's value with columns(). bool flat This property holds whether the group box is painted flat or has a frame around it. By default a group box has a surrounding frame, with the title being placed on the upper frame line. In flat mode the right, left and bottom frame lines are omitted, and only the thin line at the top is drawn. See also title. Set this property's value with setFlat() and get this property's value with isFlat(). Orientation orientation This property holds the current orientation of the group box. A horizontal group box arranges it's children in columns, while a vertical group box arranges them in rows. Thus, a horizontal group box with only one column will arrange the children vertically in that column. Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is better to set the orientation directly in the constructor. Set this property's value with setOrientation() and get this property's value with orientation(). QString title This property holds the group box title text. The group box title text will have a focus-change keyboard accelerator if the title contains &, followed by a letter. g->setTitle( "&User information" ); This produces "User information" with the U underlined; Alt+U moves the keyboard focus to the group box. There is no default title text. Set this property's value with setTitle() and get this property's value with title(). SEE ALSO
http://doc.trolltech.com/qgroupbox.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 (qgroupbox.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QGroupBox(3qt)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy