Sponsored Content
Top Forums Shell Programming and Scripting Separate lines in a single '|' separated line Post 302176022 by jim mcnamara on Monday 17th of March 2008 07:13:11 AM
Old 03-17-2008
one way
Code:
tr -s '\n' '|' < inputfile | sed 's/|$//' > newfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

two lines into one colon separated line...

Does anyone know how to get these two output lines into one colon ':' separated line with some unix command? Maybe nawk. I've tried to read the nawk and awk man pages but I don't get it right. Are these commands the one to use? Output from find command: # /sw/tools/matlab/7.0.1/man... (2 Replies)
Discussion started by: tonlu
2 Replies

2. Shell Programming and Scripting

separate two numbers separated by :

Hi all i have a data of this form 10.12.4.22:138 10.12.2.50:137 10.20.2.24:1027 10.12.2.44:138 10.12.2.44:137 10.0.4.38:58871 10.13.3.19:138 i need to separate the number out which is at the last and after ':' Please help me out Thanx in advance (5 Replies)
Discussion started by: vaibhavkorde
5 Replies

3. 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

4. Shell Programming and Scripting

read one line file and separate into multiple lines

I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field. example input line: ... (2 Replies)
Discussion started by: erlanq
2 Replies

5. Shell Programming and Scripting

read one line file and separate into multiple lines

I have one long line text with semicolon used as separator between values in that line. Now, I want to separate the line into multiple line right after every 29th field. example input line: ... (1 Reply)
Discussion started by: erlanq
1 Replies

6. Shell Programming and Scripting

Count lines separated by new line

Hi guys, I have a file which has random records like mentioned below emcpower28a pci@3,03 (disk physical name) pci@3,04 emcpower9a pci@1,03 pci@2,03 pci@3,01 pci@4,03 there could be any number of disk names for any LUN (emc...) So, I want a solution to count disk names for its... (12 Replies)
Discussion started by: prashant2507198
12 Replies

7. Shell Programming and Scripting

Make multiple lines into single quoted comma separated Linux

Hi, I want to change a file file1.txt: 1234 3456 2345 6789 3456 2333 4444 As, file2.txt in Linux: '1234','3456','2345','6789','3456','2333','4444' Could someone please help me. (Single liner sed, awk will be welcome!) (7 Replies)
Discussion started by: wiweq05
7 Replies

8. 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

9. UNIX for Beginners Questions & Answers

Output to file print as single line, not separate line

example of problem: when I echo "$e" >> /home/cogiz/file.txt result prints to file as:AA BB CC I need it to save to file as this:AA BB CC I know it's probably something really simple but any help would be greatly appreciated. Thank You. Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies

10. Shell Programming and Scripting

Help to join separate lines in a single one from xml file

Hi all, I need help to parse this xml file that has paragraphs broken in different lines and I would like to join in a single line. I hope you can understand my explanation. Thanks for any help/direction. The script could be in bash, awk, ruby, perl whatever please In the output I want:... (8 Replies)
Discussion started by: Ophiuchus
8 Replies
Mojolicious::Plugin::TagHelpers(3pm)			User Contributed Perl Documentation		      Mojolicious::Plugin::TagHelpers(3pm)

NAME
Mojolicious::Plugin::TagHelpers - Tag helpers plugin SYNOPSIS
# Mojolicious $self->plugin('TagHelpers'); # Mojolicious::Lite plugin 'TagHelpers'; DESCRIPTION
Mojolicious::Plugin::TagHelpers is a collection of HTML5 tag helpers for Mojolicious. Most form helpers can automatically pick up previous input values and will show them as default. You can also use "param" in Mojolicious::Plugin::DefaultHelpers to set them manually and let necessary attributes always be generated automatically. % param country => 'germany' unless param 'country'; <%= radio_button country => 'germany' %> Germany <%= radio_button country => 'france' %> France <%= radio_button country => 'uk' %> UK This is a core plugin, that means it is always enabled and its code a good example for learning how to build new plugins, you're welcome to fork it. HELPERS
Mojolicious::Plugin::TagHelpers implements the following helpers. "base_tag" %= base_tag Generate portable "base" tag refering to the current base URL. <base href="http://localhost/cgi-bin/myapp.pl" /> "check_box" %= check_box employed => 1 %= check_box employed => 1, id => 'foo' Generate checkbox input element. Previous input values will automatically get picked up and shown as default. <input name="employed" type="checkbox" value="1" /> <input id="foo" name="employed" type="checkbox" value="1" /> "file_field" %= file_field 'avatar' %= file_field 'avatar', id => 'foo' Generate file input element. <input name="avatar" type="file" /> <input id="foo" name="avatar" type="file" /> "form_for" %= form_for login => (method => 'POST') => begin %= text_field 'first_name' %= submit_button % end %= form_for login => {foo => 'bar'} => (method => 'POST') => begin %= text_field 'first_name' %= submit_button % end %= form_for '/login' => (method => 'POST') => begin %= text_field 'first_name' %= submit_button % end %= form_for 'http://kraih.com/login' => (method => 'POST') => begin %= text_field 'first_name' %= submit_button % end Generate portable form for route, path or URL. For routes that allow "POST" but not "GET", a "method" attribute will be automatically added. <form action="/path/to/login" method="POST"> <input name="first_name" /> <input value="Ok" type="submit" /> </form> <form action="/path/to/login/bar" method="POST"> <input name="first_name" /> <input value="Ok" type="submit" /> </form> <form action="/login" method="POST"> <input name="first_name" /> <input value="Ok" type="submit" /> </form> <form action="http://kraih.com/login" method="POST"> <input name="first_name" /> <input value="Ok" type="submit" /> </form> "hidden_field" %= hidden_field foo => 'bar' %= hidden_field foo => 'bar', id => 'bar' Generate hidden input element. <input name="foo" type="hidden" value="bar" /> <input id="bar" name="foo" type="hidden" value="bar" /> "image" %= image '/images/foo.png' %= image '/images/foo.png', alt => 'Foo' Generate image tag. <img src="/images/foo.png" /> <img alt="Foo" src="/images/foo.png" /> "input_tag" %= input_tag 'first_name' %= input_tag first_name => 'Default name' %= input_tag 'employed', type => 'checkbox' Generate form input element. Previous input values will automatically get picked up and shown as default. <input name="first_name" /> <input name="first_name" value="Default name" /> <input name="employed" type="checkbox" /> "javascript" %= javascript '/script.js' %= javascript begin var a = 'b'; % end Generate portable script tag for "Javascript" asset. <script src="/script.js" type="text/javascript" /> <script type="text/javascript"><![CDATA[ var a = 'b'; ]]></script> "link_to" %= link_to Home => 'index' %= link_to index => {foo => 'bar'} => (class => 'links') => begin Home % end <%= link_to index => begin %>Home<% end %> <%= link_to '/path/to/file' => begin %>File<% end %> <%= link_to 'http://mojolicio.us' => begin %>Mojolicious<% end %> <%= link_to url_for->query(foo => 'bar')->to_abs => begin %>Retry<% end %> Generate portable link to route, path or URL, defaults to using the capitalized link target as content. <a href="/path/to/index">Home</a> <a class="links" href="/path/to/index/bar">Home</a> <a href="/path/to/index">Home</a> <a href="/path/to/file">File</a> <a href="http://mojolicio.us">Mojolicious</a> <a href="http://127.0.0.1:3000/current/path?foo=bar">Retry</a> "password_field" %= password_field 'pass' %= password_field 'pass', id => 'foo' Generate password input element. <input name="pass" type="password" /> <input id="foo" name="pass" type="password" /> "radio_button" %= radio_button country => 'germany' %= radio_button country => 'germany', id => 'foo' Generate radio input element. Previous input values will automatically get picked up and shown as default. <input name="country" type="radio" value="germany" /> <input id="foo" name="country" type="radio" value="germany" /> "select_field" %= select_field language => [qw(de en)] %= select_field language => [qw(de en)], id => 'lang' %= select_field country => [[Germany => 'de'], 'en'] %= select_field country => [{Europe => [[Germany => 'de'], 'en']}] %= select_field country => [[Germany => 'de', class => 'europe'], 'en'] Generate select, option and optgroup elements. Previous input values will automatically get picked up and shown as default. <select name="language"> <option value="de">de</option> <option value="en">en</option> </select> <select id="lang" name="language"> <option value="de">de</option> <option value="en">en</option> </select> <select name="country"> <option value="de">Germany</option> <option value="en">en</option> </select> <select id="lang" name="language"> <optgroup label="Europe"> <option value="de">Germany</option> <option value="en">en</option> </optgroup> </select> <select name="country"> <option class="europe" value="de">Germany</option> <option value="en">en</option> </select> "stylesheet" %= stylesheet '/foo.css' %= stylesheet begin body {color: #000} % end Generate portable style or link tag for "CSS" asset. <link href="/foo.css" media="screen" rel="stylesheet" type="text/css" /> <style type="text/css"><![CDATA[ body {color: #000} ]]></style> "submit_button" %= submit_button %= submit_button 'Ok!', id => 'foo' Generate submit input element. <input type="submit" value="Ok" /> <input id="foo" type="submit" value="Ok!" /> "t" %=t div => 'some & content' Alias for "tag". <div>some &amp; content</div> "tag" %= tag 'div' %= tag 'div', id => 'foo' %= tag div => 'some & content' <%= tag div => begin %>some & content<% end %> HTML5 tag generator. <div /> <div id="foo" /> <div>some &amp; content</div> <div>some & content</div> Very useful for reuse in more specific tag helpers. $self->tag('div'); $self->tag('div', id => 'foo'); $self->tag(div => sub { 'Content' }); Results are automatically wrapped in Mojo::ByteStream objects to prevent accidental double escaping. "text_field" %= text_field 'first_name' %= text_field first_name => 'Default name' %= text_field first_name => 'Default name', class => 'user' Generate text input element. Previous input values will automatically get picked up and shown as default. <input name="first_name" /> <input name="first_name" value="Default name" /> <input class="user" name="first_name" value="Default name" /> "text_area" %= text_area 'foo' %= text_area foo => 'Default!', cols => 40 %= text_area foo => begin Default! % end Generate textarea element. Previous input values will automatically get picked up and shown as default. <textarea name="foo"></textarea> <textarea cols="40" name="foo">Default!</textarea> <textarea name="foo"> Default! </textarea> METHODS
Mojolicious::Plugin::TagHelpers inherits all methods from Mojolicious::Plugin and implements the following new ones. "register" $plugin->register($app); Register helpers in Mojolicious application. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojolicious::Plugin::TagHelpers(3pm)
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy