Sponsored Content
Top Forums Shell Programming and Scripting Force new line after second space Post 302969408 by RavinderSingh13 on Tuesday 22nd of March 2016 11:55:46 AM
Old 03-22-2016
Hello Junaid Subhani,

Could you please try following and let me know if this helps.
Code:
xargs -n2 <  Input_file

Output will be as follows.
Code:
65450524121|2015-11-20 20:17:59.0
15062464121|2015-12-19 11:44:23.0
01419644121|2016-03-19 09:56:41.0
55146524121|2015-08-17 04:51:55.0
11947314121|2015-12-03 19:25:26.0
29906064121|2015-10-28 18:25:00.0
71585954121|2015-06-10 22:12:13.0
87207383121|2015-11-14 14:15:10.0
77259583121|2015-06-11 16:16:56.0
52186364121|2015-09-25 19:03:33.0
06360373121|2016-02-13 03:01:51.0
42749704121|2015-06-12 11:16:12.0
08136964121|2015-08-02 08:38:16.0
77927982021|2015-06-12 14:03:50.0
29058473121|2016-01-27 08:45:21.0
76950351121|2015-06-12 15:20:28.0
86970264121|2016-03-13 20:01:42.0
99917064121|2016-03-15 08:27:13.0
26313374121|2016-03-05 14:10:40.0
57014064121|2016-03-02 11:22:50.0
23145234121|2015-11-30 17:29:50.0
32740714121|2016-03-02 16:00:43.0
99956193121|2015-11-14 15:56:05.0
68785893121|2015-10-24 19:17:40.0
27418563121|2016-03-13 11:06:56.0
51823193121|2015-07-20 10:49:44.0
75230854121|2016-02-29 13:38:16.0

If your requirement is different then the output shown above please do share the more details about it, hope this helps you.

Thanks,
R. Singh
These 3 Users Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace space with new line

i have a file named as templist which looks like this: i want to translate spaces to a new line so that the file would look like this im using sed with this sed -e 's/" "/\n/' templist > templist.out but it doesn't work. can someone please help me. (2 Replies)
Discussion started by: dakid
2 Replies

2. Shell Programming and Scripting

How to print the words in the same line with space or to the predefined line?

HI, cat test abc echo "def" >> test output is cat test abc def the needed output is cat test abc def and so on (5 Replies)
Discussion started by: jobycxa
5 Replies

3. Shell Programming and Scripting

Stripping out more than a space from a line, but keep single space.

Hi all, Is there a way to perform the above, I am trying to strip out more than one space from a line, but keep the single space. See below output example. My Name is test test2 test3 test4 test5 My Name is test test2 test3 test4 test5 Please note that the lines would contain... (7 Replies)
Discussion started by: eo29
7 Replies

4. Shell Programming and Scripting

Replace end of line with a space

for eg: i have i/p file as: ================ i wnt to change end of line ================= my require ouput is like: i wnt to change end of line ==================== (7 Replies)
Discussion started by: RahulJoshi
7 Replies

5. Shell Programming and Scripting

Parse a line by a space

I am trying to show each word on a separate line, but read in all the words on one command line. Below is the code I have right now: read name MyString=$name name2=" " echo $MyString | awk -v ORS="" '{ gsub(/./,"&\n") ; print }' | \ while read char do if then ... (8 Replies)
Discussion started by: tvb2727
8 Replies

6. Shell Programming and Scripting

Space at beginning of the line

How can I delete spaces at the begining of all lines of my file ? (2 Replies)
Discussion started by: Sara_84
2 Replies

7. Shell Programming and Scripting

remove space of each line

Hi Guys, I want remove starting space of each line ... My Input: A B C D E C V F G H F R T Y U D F G H J L O I U Y G P O K O P L O L O I P P O P P P P P My Output: A B C D E C V F G H (7 Replies)
Discussion started by: asavaliya
7 Replies

8. Shell Programming and Scripting

Check if line has a space

Hi, I want to check if the given line from a text file has a spaces in between. if it does, then I want to add '"' double quotes at the beginning and end of the line. Otherwise leave the line as it is. For example, below is the sample content from my file. $cat file.txt test1 test2... (6 Replies)
Discussion started by: svajhala
6 Replies

9. UNIX for Dummies Questions & Answers

How to remove fields space and append next line to previous line.?

awk 'BEGIN{FS = "Ç"} NR == 1 {p = $0; next} NF > 1 {print p; p = $0} NF <= 1 {p = (p " " $0)} END {print p}' input.txt > output.txt This is what the input data file looks like with broken lines Code: 29863 Ç890000000 Ç543209911 ÇCHNGOHG Ç000000001 Ç055 ... (4 Replies)
Discussion started by: cumeh1624
4 Replies

10. Shell Programming and Scripting

Using the entire line with space in between

Hi Folks, I have a report data like the one seen below. FRUITS@NEW_ORANGE(1500 04/29) FRUITS@NEW_ORANGE(1500 05/04) FRUITS@NEW_ORANGE(1500 05/05) FRUITS@NEW_ORANGE(1500 05/07) FRUITS@NEW_ORANGE(1500 05/12) I need to use each of this lines separately in another for loop like the one... (2 Replies)
Discussion started by: jayadanabalan
2 Replies
fmt(1)							      General Commands Manual							    fmt(1)

NAME
fmt - format text SYNOPSIS
width] [file...] DESCRIPTION
The command is a simple text formatter that fills and joins lines to produce output lines of (up to) the number of characters specified in the width option. The default width is 72. concatenates the arguments. If none are given, formats text from the standard input. Blank lines are preserved in the output, as is the spacing between words. does not fill lines beginning with a period for compatibility with Nor does it fill lines starting with Indentation is preserved in the output and input lines with differing indentation are not joined (unless is used). can also be used as an in-line text filter for the command: reformats the text between the cursor location and the end of the paragraph. Options recognizes the following options: Crown margin mode. Preserve the indentation of the first two lines within a paragraph and align the left margin of each subsequent line with that of the second line. This is useful for tagged paragraphs. Split lines only. Do not join short lines to form longer ones. This prevents sample lines of code, and other such "formatted" text, from being unduly combined. Fill output lines to up to width columns. WARNINGS
The width option is acceptable for BSD compatibility, but it may go away in future releases. SEE ALSO
nroff(1), vi(1). fmt(1)
All times are GMT -4. The time now is 03:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy