Sponsored Content
Full Discussion: Text Splitter
Top Forums Shell Programming and Scripting Text Splitter Post 302687909 by pamu on Friday 17th of August 2012 08:19:03 AM
Old 08-17-2012
Bug

Quote:
Originally Posted by Franklin52
Another approach:
Code:
awk -F\" '/BEGIN DSJOB/{s=$0;getline;f=$NF ".txt";print s > f}{print > f} /END DSJOB/{close(f)}' file

we need to give $(NF-1)

Code:
awk -F\" '/BEGIN DSJOB/{s=$0;getline;f=$(NF-1)".txt";print s > f}{print > f} /END DSJOB/{close(f)}' test_temp

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File splitter by nth row

I need to split a file into n separate files of about the same size. The way the file will be split is at every nth row, starting with the first row, that row will be cut and copied to it's corresponding new file so that each file has unique records. Any 'leftovers' will go into the last file. e.g.... (4 Replies)
Discussion started by: sitney
4 Replies

2. Programming

Help with splitter code in JAVA

I was creating a file using splitter and printwriter. The result in the file come out as: TO:bbb,ccc,eee Instead of, TO:bbb TO:ccc TO:eee May I know what's wrong with this? (1 Reply)
Discussion started by: eel
1 Replies

3. Shell Programming and Scripting

Syllable splitter in Perl

Hello, I am a relative newbie and want to split Names in English into syllables. Does anyone know of a perl script which does that. Since my main area is linguistics, I would be happy to add rules to it and post the perl script back for other users. I tried the CPan perl modules but they don't... (6 Replies)
Discussion started by: gimley
6 Replies

4. Shell Programming and Scripting

File Splitter output filename

Issue: I am able to split source file in multiple files of 10 rows each but unable to get the required outputfile name. please advise. Details: input = A.txt having 44 rows required output = A_001.txt , A_002.txt and so on. Can below awk be modified to give required result current... (19 Replies)
Discussion started by: santosh2k2
19 Replies

5. Shell Programming and Scripting

Source xml file splitter

I have a source file that contains multiple XML files concatenated in it. The separator string between files is <?xml version="1.0" encoding="utf-8"?>. I wanted to split files in multiple files with mentioned names. I had used a awk code earlier to spilt files in number of lines i.e. awk... (10 Replies)
Discussion started by: santosh2k2
10 Replies

6. Shell Programming and Scripting

File splitter

I have below script which does splitting based on a different criteria. can it be amended to produce required result SrcFileName=XML_DUMP awk '/<\?xml version="1\.0" encoding="utf-8"\?>/{n++} n{f="'"${SrcFileName}_"'" sprintf("%04d",n) ".txt" print >> f close(f)}' $SrcFileName.txt My... (3 Replies)
Discussion started by: santosh2k2
3 Replies

7. Shell Programming and Scripting

awk or perl script for preposition splitter

Hello, I am writing a Natural Language Parser and one of the tools I need is to separate prepositional phrase markers which begin with a Preposition. I have a long list of such markers (sample given below)and am looking for a script in awk or perl which will allow me to access a look-up file... (2 Replies)
Discussion started by: gimley
2 Replies

8. Shell Programming and Scripting

awk to skip lines find text and add text based on number

I am trying to use awk skip each line with a ## or # and check each line after for STB= and if that value in greater than or = to 0.8, then at the end of line the text "STRAND BIAS" is written in else "GOOD". So in the file of 4 entries attached. awk tried: awk NR > "##"' "#" -F"STB="... (6 Replies)
Discussion started by: cmccabe
6 Replies

9. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
QwtTextEngine(3)						 Qwt User's Guide						  QwtTextEngine(3)

NAME
QwtTextEngine - Abstract base class for rendering text strings. SYNOPSIS
#include <qwt_text_engine.h> Inherited by QwtMathMLTextEngine, QwtPlainTextEngine, and QwtRichTextEngine. Public Member Functions virtual void draw (QPainter *painter, const QRect &rect, int flags, const QString &text) const =0 virtual int heightForWidth (const QFont &font, int flags, const QString &text, int width) const =0 virtual bool mightRender (const QString &text) const =0 virtual void textMargins (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const =0 virtual QSize textSize (const QFont &font, int flags, const QString &text) const =0 virtual ~QwtTextEngine () Protected Member Functions QwtTextEngine () Detailed Description Abstract base class for rendering text strings. A text engine is responsible for rendering texts for a specific text format. They are used by QwtText to render a text. QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library. QwtMathMLTextEngine can be found in Qwt MathML extension, that needs the MathML renderer of the Qt solutions package. Unfortunately it is only available with a commercial Qt license. See also: QwtText::setTextEngine() Constructor &; Destructor Documentation QwtTextEngine::~QwtTextEngine () [virtual] Destructor. QwtTextEngine::QwtTextEngine () [protected] Constructor. Member Function Documentation virtual void QwtTextEngine::draw (QPainter *painter, const QRect &rect, intflags, const QString &text) const [pure virtual] Draw the text in a clipping rectangle Parameters: painter Painter rect Clipping rectangle flags Bitwise OR of the flags like in for QPainter::drawText text Text to be rendered Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual int QwtTextEngine::heightForWidth (const QFont &font, intflags, const QString &text, intwidth) const [pure virtual] Find the height for a given width Parameters: font Font of the text flags Bitwise OR of the flags used like in QPainter::drawText text Text to be rendered width Width Returns: Calculated height Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual bool QwtTextEngine::mightRender (const QString &text) const [pure virtual] Test if a string can be rendered by this text engine Parameters: text Text to be tested Returns: true, if it can be rendered Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual void QwtTextEngine::textMargins (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const [pure virtual] Return margins around the texts The textSize might include margins around the text, like QFontMetrics::descent. In situations where texts need to be aligend in detail, knowing these margins might improve the layout calculations. Parameters: font Font of the text text Text to be rendered left Return value for the left margin right Return value for the right margin top Return value for the top margin bottom Return value for the bottom margin Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. virtual QSize QwtTextEngine::textSize (const QFont &font, intflags, const QString &text) const [pure virtual] Returns the size, that is needed to render text Parameters: font Font of the text flags Bitwise OR of the flags like in for QPainter::drawText text Text to be rendered Returns: Caluclated size Implemented in QwtPlainTextEngine, QwtRichTextEngine, and QwtMathMLTextEngine. Author Generated automatically by Doxygen for Qwt User's Guide from the source code. Version 5.2.2 Mon Aug 1 2011 QwtTextEngine(3)
All times are GMT -4. The time now is 06:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy