Sponsored Content
Top Forums Shell Programming and Scripting Splitting a single line into multiple lines Post 63143 by bhargav on Wednesday 23rd of February 2005 12:56:11 AM
Old 02-23-2005
fold -w 5 file1 > file2


good one Ygor ! I prefer this one compared to the long one i wrote.:-)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Splitting the line in multiple lines

Hi Guys, I need a help. I am pretty new to the shell level programing. I was trying to split a long lines to a multiple lines with few conditions. I goggle for the code and found some snippets and tried to modified it but I got few strange problems too. I have to split the lines if line is ... (3 Replies)
Discussion started by: dd_sh
3 Replies

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

3. Shell Programming and Scripting

Combine multiple lines in single line

This is related to one of my previous post but now with a slight difference: I need the "Updated:" to be in one line as well as the "Information:" on one line as well. These are in multiple lines right now as seen below. These can have 2 or more lines that needs to be in one line. System name:... (8 Replies)
Discussion started by: The One
8 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

splitting a huge line of file into multiple lines with fixed number of columns

Hi, I have a huge file with a single line. But I want to break that line into lines of with each line having five columns. My file is like this: code: "hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","you." I want it like this: code:... (1 Reply)
Discussion started by: rajsharma
1 Replies

6. Shell Programming and Scripting

Splitting Single line into multiple line

Hi All, I am reading a line from a file and writing it to other file. Whenever I got a particular line then I want that line to be splited into 4 line and written it to new file. e.g My line is U_ABC connector3 pin24E connector4 pin25E connector5 pin26E connector6 pin27E connector7... (2 Replies)
Discussion started by: diehard
2 Replies

7. Shell Programming and Scripting

Splitting one line into multiple lines

Hi, I have one problem scenorio as below. my source file is : cat input_file. "hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","y ou." my output should be like. "hi","there","how","are","you?", "It","was","great","working","with",... (7 Replies)
Discussion started by: abhilash_nakka
7 Replies

8. Shell Programming and Scripting

Making multiple lines as single line

Hi All, I have a spool file which as shown below. I want to make it as single line after every semicolon. In this case there should be 2 lines in vi editor. I am not used to use sed so could you guys please help me out ? exec spk_dba.sp_runsql('ALP','CREATE DATABASE LINK "TEST" CONNECT TO... (2 Replies)
Discussion started by: nicolas38
2 Replies

9. Shell Programming and Scripting

Merge multiple lines into a single line

Hi all, I'm relatively new to scripting, I can do pretty basic things. I have a daily log file that looks like: timestamp=2017-06-28-01.01.35.080576; event status=0; userid=user1; authid=user1; application id=10.10.10.10.11111.12345678901; application name=GUI; ... (29 Replies)
Discussion started by: dwdnet
29 Replies

10. 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
ELVFMT(1)							   User commands							 ELVFMT(1)

NAME
elvfmt - adjust line-length for paragraphs of text SYNOPSIS
elvfmt [-w width | -width] [-s] [-c] [-i chars] [-C] [-M] [file]... VERSION
This page describes the Elvis 2.2_0 version of elvfmt. See elvis(1). DESCRIPTION
elvfmt is a simple text formatter. It inserts or deletes newlines, as necessary, to make all lines in a paragraph be approximately the same width. It preserves indentation and word spacing. If you don't name any files on the command line, then elvfmt will read from stdin. It is typically used from within vi(1) or elvis(1) to adjust the line breaks in a single paragraph. To do this, move the cursor to the top of the paragraph, type "!}elvfmt", and hit <Return>. OPTIONS
-w width or -width Use a line width of width characters instead of the default of 72 characters. -s Don't join lines shorter than the line width to fill paragraphs. -c Try to be smarter about crown margins. Specifically, this tells elvfmt to expect the first line of each paragraph to have a differ- ent indentation than subsequent lines. If text from the first input line is wrapped onto the second output line, then elvfmt will scan ahead to figure out what indentation it should use for the second output line, instead of reusing the first line's indentation. -i chars Allow the indentation text to include any character from chars, in addition to spaces and tabs. You should quote the chars list to protect it from the shell. -C and -M These are shortcuts for combinations of other flags. is short for and is useful for reformatting C/C++ comments. is short for and is useful for reformatting email messages. SEE ALSO
vi(1), elvis(1) AUTHOR
Steve Kirkendall kirkenda@cs.pdx.edu ELVFMT(1)
All times are GMT -4. The time now is 04:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy