Sponsored Content
Top Forums Programming PERL:Combining multiple lines to single line Post 302624457 by yazu on Monday 16th of April 2012 09:45:32 AM
Old 04-16-2012
Code:
cat FILE
I have a
pen and
notebook.

I have a
pen and
notebook.
                                                                          ~
perl -00 -pe 's/\n/ /g; s/ $/\n/' FILE
I have a pen and notebook.
I have a pen and notebook.

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replacing multiple lines with single line

Can any one give me the idea on replacing multiple blank lines with a single blank line? Please conside it for a file having more than 100 number of characters. Regards, Siba (3 Replies)
Discussion started by: siba.s.nayak
3 Replies

2. Shell Programming and Scripting

Getting multiple messy lines into one single line

I have a file that contains the following: :@:176:@:4:@:name:@:file:@:this is a summary:@:description can be long but who knows can even have <br> tags.:@:how to:@:type:@:18544:@:550:@:400:END: :@:177:@:9:@:name:@:file:@:summary:@:this will containg... (18 Replies)
Discussion started by: sysrenan
18 Replies

3. Shell Programming and Scripting

Multiple lines into a single line

Hi, I've some files with the following data and i need to convert the lines between the separator ---, into a single line. I've tried with the paste cmd but my main problem is that the number of lines between the separator is not fix, it can very between 1-4 lines. Input --- 2010-02-22... (4 Replies)
Discussion started by: RickyC9999
4 Replies

4. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

5. Shell Programming and Scripting

merging multiple lines into single line

Hi, 1. Each message starts with date 2. There is blank line between each message 3. Each message does not contain same number of lines. Any help in merging multiple lines in each message to a single line is much appreciated. AIX: Korn Shell Error log file looks like below. ... (5 Replies)
Discussion started by: bala123
5 Replies

6. UNIX for Dummies Questions & Answers

Need help combining txt files w/ multiple lines into csv single cell - also need data merge

:confused:Hello -- i just joined the forums. I am a complete noob -- only about 1 week into learning how to program anything... and starting with linux. I am working in Linux terminal. I have a folder with a bunch of txt files. Each file has several lines of html code. I want to combine... (2 Replies)
Discussion started by: jetsetter
2 Replies

7. Shell Programming and Scripting

Combining multiple block of lines in one comma separated line

Hi Everyone, On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
Discussion started by: gr8_usk
7 Replies

8. Shell Programming and Scripting

Combining lines into a single line

i have a file (where the column values are separated by ' and the text can be enclosed in ~) which contains data in form of 4461,2,~Basic: 2 Years/Unlimited Miles Drivetrain: Gas Engine 2 Years/Unlimited Miles Duramax Engine 3 Years/Unlimited... (2 Replies)
Discussion started by: rahulchandak
2 Replies

9. UNIX for Beginners Questions & Answers

Multiple lines to single line

I have code as below # create temporary table `temp4277`(key(waybill_no)) select waybill_no,concat_ws('',card_type,card_series_no) cardinfo from rfid_temp_ticket where waybill_no='4277' group by... (4 Replies)
Discussion started by: kaushik02018
4 Replies

10. Shell Programming and Scripting

Log4j combining lines to single line

Hi, Our log4j file contents look like this: 2018-11-20T00:06:58,888 INFO ql.Driver: Executing command(queryId=hive_20181120000656_49af4ad0-1d37-4312-872c-a247ed80c181): CREATE TABLE RESULTS.E7014485_ALL_HMS_CAP1 AS SELECT name,dept from employee Where employee='Jeff'... (4 Replies)
Discussion started by: wahi80
4 Replies
ttk::notebook(n)						 Tk Themed Widget						  ttk::notebook(n)

__________________________________________________________________________________________________________________________________________________

NAME
ttk::notebook - Multi-paned container widget SYNOPSIS
ttk::notebook pathname ?options...? pathname add window ?options...? pathname insert index window ?options...? _________________________________________________________________ DESCRIPTION
A ttk::notebook widget manages a collection of windows and displays a single one at a time. Each slave window is associated with a tab, which the user may select to change the currently-displayed window. STANDARD OPTIONS
-class -cursor -takefocus -style See the ttk_widget manual entry for details on the standard options. WIDGET-SPECIFIC OPTIONS [-height height] If present and greater than zero, specifies the desired height of the pane area (not including internal padding or tabs). Otherwise, the maximum height of all panes is used. [-padding padding] Specifies the amount of extra space to add around the outside of the notebook. The padding is a list of up to four length specifications left top right bottom. If fewer than four elements are specified, bottom defaults to top, right defaults to left, and top defaults to left. [-width width] If present and greater than zero, specifies the desired width of the pane area (not including internal padding). Otherwise, the maximum width of all panes is used. TAB OPTIONS
The following options may be specified for individual notebook panes: [-state state] Either normal, disabled or hidden. If disabled, then the tab is not selectable. If hidden, then the tab is not shown. [-sticky sticky] Specifies how the slave window is positioned within the pane area. Value is a string containing zero or more of the characters n, s, e, or w. Each letter refers to a side (north, south, east, or west) that the slave window will "stick" to, as per the grid geometry manager. [-padding padding] Specifies the amount of extra space to add between the notebook and this pane. Syntax is the same as for the widget -padding option. [-text text] Specifies a string to be displayed in the tab. [-image image] Specifies an image to display in the tab. See ttk_widget(n) for details. [-compound compound] Spec- ifies how to display the image relative to the text, in the case both -text and -image are present. See label(n) for legal values. [-underline underline] Specifies the integer index (0-based) of a character to underline in the text string. The underlined character is used for mnemonic activation if ttk::notebook::enableTraversal is called. TAB IDENTIFIERS
The tabid argument to the following commands may take any of the following forms: o An integer between zero and the number of tabs; o The name of a slave window; o A positional specification of the form "@x,y", which identifies the tab o The literal string "current", which identifies the currently-selected tab; or: o The literal string "end", which returns the number of tabs (only valid for "pathname index"). WIDGET COMMAND
pathname add window ?options...? Adds a new tab to the notebook. See TAB OPTIONS for the list of available options. If window is currently managed by the notebook but hidden, it is restored to its previous position. pathname configure ?options? See ttk::widget(n). pathname cget option See ttk::widget(n). pathname forget tabid Removes the tab specified by tabid, unmaps and unmanages the associated window. pathname hide tabid Hides the tab specified by tabid. The tab will not be displayed, but the associated window remains managed by the notebook and its configuration remembered. Hidden tabs may be restored with the add command. pathname identify component x y Returns the name of the element under the point given by x and y, or the empty string if no component is present at that location. The following subcommands are supported: pathname identify element x y Returns the name of the element at the specified location. pathname identify tab x y Returns the index of the tab at the specified location. pathname index tabid Returns the numeric index of the tab specified by tabid, or the total number of tabs if tabid is the string "end". pathname insert pos subwindow options... Inserts a pane at the specified position. pos is either the string end, an integer index, or the name of a managed subwindow. If subwindow is already managed by the notebook, moves it to the specified position. See TAB OPTIONS for the list of available options. pathname instate statespec ?script...? See ttk::widget(n). pathname select ?tabid? Selects the specified tab. The associated slave window will be displayed, and the previously-selected window (if different) is unmapped. If tabid is omitted, returns the widget name of the currently selected pane. pathname state ?statespec? See ttk::widget(n). pathname tab tabid ?-option ?value ... Query or modify the options of the specific tab. If no -option is specified, returns a dictionary of the tab option values. If one -option is specified, returns the value of that option. Otherwise, sets the -options to the corresponding values. See TAB OPTIONS for the available options. pathname tabs Returns the list of windows managed by the notebook. KEYBOARD TRAVERSAL
To enable keyboard traversal for a toplevel window containing a notebook widget $nb, call: ttk::notebook::enableTraversal $nb This will extend the bindings for the toplevel window containing the notebook as follows: o Control-Tab selects the tab following the currently selected one. o Shift-Control-Tab selects the tab preceding the currently selected one. o Alt-K, where K is the mnemonic (underlined) character of any tab, will select that tab. Multiple notebooks in a single toplevel may be enabled for traversal, including nested notebooks. However, notebook traversal only works properly if all panes are direct children of the notebook. VIRTUAL EVENTS
The notebook widget generates a <<NotebookTabChanged>> virtual event after a new tab is selected. EXAMPLE
pack [ttk::notebook .nb] ttk::notebook::enableTraversal .nb SEE ALSO
ttk::widget(n), grid(n) KEYWORDS
pane, tab Tk 8.5 ttk::notebook(n)
All times are GMT -4. The time now is 03:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy