Sponsored Content
Top Forums Shell Programming and Scripting Put three points at the end of a line Post 302864627 by thailand on Thursday 17th of October 2013 01:01:13 AM
Old 10-17-2013
I'm gone try this possible solutions but I can't use the solution from shamrock because the words are examples so in every file I have different words but anyway thanks.

---------- Post updated 10-17-13 at 12:01 AM ---------- Previous update was 10-16-13 at 10:29 PM ----------

P { margin-bottom: 0.21cm; } Hello

The solutions that you give me doesn't work on my computer but I
try now this :
awk '{ if ($0 ~ /[a-z]$/) {print $0"..."} else {print $0} }' file
(but that is the same like the solution with sed :sed 's/[a-z]$/&.../g' file)
en this works but he put the three points on every line who ends with a
letter.
The problem is that he can put only on the last line between two empty
lines. So when I have only one line between two empty lines he must do it.
When I have two lines between two empty lines he must take only the last line.
example



To honour, to glory, to a valiant death


and then on to the hall of heroes. Skal!


Why don't you just give
Lord Beothric what he wants?


die with the faith that you
have stood shield to shield


with your brothers.


In this example he must put only after the words “ death shield “ the three points
and not after “give you”.
The empty lines are imported and they cannot away.
So the output must be like this


To honour, to glory, to a valiant death...


and then on to the hall of heroes. Skal!


Why don't you just give
Lord Beothric what he wants?


die with the faith that you
have stood shield to shield ...


with your brothers.
Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

put a semicolon at the end of each line of a file

hi, Consider there is a file containing 200 lines. please let me know which command is to be used to put a semicolon at the end of each line. if no single command is there then how it can be achieved. (1 Reply)
Discussion started by: surjyap
1 Replies

2. Shell Programming and Scripting

how to put nil at the end of each records.

Hello, I have a file with 100,000 records. Each record have many fileds and used "," to split (like below): 0100,apple,john,2233,N,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,IDN, 0201,steve,2435,N,0,49,6.658,0,6.658,37.104302,0,0,0,0,0,37.104302,0,49,6.658,0,6.658,37.104302,UAE,AED... (2 Replies)
Discussion started by: happyv
2 Replies

3. UNIX and Linux Applications

Gnuplot question: how to plot 3D points as colored points in map view?

I have a simple gnuplot question. I have a set of points (list of x,y,z values; irregularly spaced, i.e. no grid) that I want to plot. I want the plot to look like this: - points in map view (no 3D view) - color of each point should depend on its z-value. - I want to define my own color scale -... (0 Replies)
Discussion started by: karman
0 Replies

4. Shell Programming and Scripting

to put date at the end of each line

#!/bin/ksh if test -f file6.txt then rm file6.txt fi a=`date +"%F"` awk '{print $0,"$a"}' file3.txt > file6.txt ----------------------------------------------------------------- i need to append date at the end of each line in file 3 and o/p it to file6.txt (3 Replies)
Discussion started by: ali560045
3 Replies

5. Shell Programming and Scripting

Interpolating on a line between to points

I have two points which represent the start and end points of a line. I need to interpolate a number of points on the line between the two points. Point 1: x = 455989.0 y = 8673453.4 Point 2: x = 283957.6 y = 8691250.1 The two points I have are coordinates given in UTM format. x... (3 Replies)
Discussion started by: mattings
3 Replies

6. Shell Programming and Scripting

How to put count for first element in a file at the end

Hi, I have a file where I need to count the total for the first element and put it back at the end of file... here is the example... input.. FHDR|ABC|20100607| |ABC|8453|CDE|E166|||| 123|ABC|8453|CDE|E166|||| 123|ABC|8453|CDE|E166|||| 111|ABC|8453|CDE|E166||||... (8 Replies)
Discussion started by: donadarsh
8 Replies

7. Shell Programming and Scripting

put string end of the line

I've a problem to put .h end of the line..below my input file fg_a bb fg_b bb fg_c bb fg_d aa fg_f ee and i want the output file as below fg_a.h bb fg_b.h bb fg_c.h bb fg_d.h (6 Replies)
Discussion started by: zulabc
6 Replies

8. Shell Programming and Scripting

Remove line based on string and put new line with parameter

Hi Folks, I am new to ksh, i have informatica parameter file that i need to update everyday with shell script. i need your help updating this file with new parameters. sample data $$TABLE1_DATE=04-27-2011 $$TABLE2_DATE=04-23-2011 $$TABLE3_DATE=03-19-2011 .......Highligned... (4 Replies)
Discussion started by: victor369
4 Replies

9. Shell Programming and Scripting

Using sed to put text end of line

how to use sed to put .txt end of line..my input file below file1 make=^bak12^". DEV=LONG^cmd/usr/bak/ade4^" ..................................... file 2 make=^and_LONG/bak12^". DEV=LONG^cmd/usr/bak/ban3^" .......................................... file 3... (6 Replies)
Discussion started by: zulabc
6 Replies

10. Shell Programming and Scripting

How to use sed to put string end of line?

I have several file as below, and i want to put .txt to specific text contain ^main=EXE^cmd=run script /usr/prog/bd_, file1 7.9102 12.1528 16.3672 7.4002 ^main=EXE^cmd=run script /usr/prog/bd_123^" line 16.3672 7.3134 17.8711 6.0981 file 2 7.9102 12.1528 16.3672 7.4002 ... (8 Replies)
Discussion started by: zulabc
8 Replies
GREP(1) 						      General Commands Manual							   GREP(1)

NAME
grep - search a file for a pattern SYNOPSIS
grep [ option ... ] pattern [ file ... ] DESCRIPTION
Grep searches the input files (standard input default) for lines (with newlines excluded) that match the pattern, a regular expression as defined in regexp(6). Normally, each line matching the pattern is `selected', and each selected line is copied to the standard output. The options are -c Print only a count of matching lines. -h Do not print file name tags (headers) with output lines. -i Ignore alphabetic case distinctions. The implementation folds into lower case all letters in the pattern and input before interpre- tation. Matched lines are printed in their original form. -l (ell) Print the names of files with selected lines; don't print the lines. -L Print the names of files with no selected lines; the converse of -l. -n Mark each printed line with its line number counted in its file. -s Produce no output, but return status. -v Reverse: print lines that do not match the pattern. Output lines are tagged by file name when there is more than one input file. (To force this tagging, include /dev/null as a file name argument.) Care should be taken when using the shell metacharacters $*[^|()= and newline in pattern; it is safest to enclose the entire expression in single quotes '...'. SOURCE
/sys/src/cmd/grep.c SEE ALSO
ed(1), awk(1), sed(1), sam(1), regexp(6) DIAGNOSTICS
Exit status is null if any lines are selected, or non-null when no lines are selected or an error occurs. GREP(1)
All times are GMT -4. The time now is 05:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy