07-12-2002
ed filename <<EOF
%s/$/,/
$
s/,$//
w
q
EOF
Not sure, cannot test it right now ...
Last edited by pipin; 07-15-2002 at 03:08 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi i would like to add line numbers to end of each line in a file.
I am able to do it in the front of each line using sed, but not able to add at the end of the file.
Can anyone suggest
The following code adds line number to start of each line
sed = filename | sed 'N;s/\n/\t/'
how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies
2. Shell Programming and Scripting
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I have this sample file (actual file is larger) and i need to add comma at the end of every line.
1234
4335
232345
1212
3535
Output
1234,
4335,
232345,
1212,
3535,
TIA - jak (2 Replies)
Discussion started by: jakSun8
2 Replies
4. Shell Programming and Scripting
Example data
Gi1/10
Gi1/12 xl32lytscb07
3/11 to nyc
3/12 41764 ecomm
3/13 hxcsxsa 2/1
3/14 ziim570-rsvd
3/15 xl3NDSADM
Po1 VPC trunk to xl3-i
Po2 ***DO NOT ENABLE**
Po13 *** VPC link to
Po101
Po102 xl3-2lyg1accsgh-fe... (7 Replies)
Discussion started by: sumguy
7 Replies
5. Shell Programming and Scripting
how to Remove comma as last charector in end of last line of file:
example:
input file
---------------
aaaaaa,
bbbbbb,
cccc,
12345,
____________
output file :
-----------
aaaaaa,
bbbbbb, (6 Replies)
Discussion started by: RahulJoshi
6 Replies
6. Shell Programming and Scripting
I have a file with dates as
'2013-01-01'
'2013-01-02'
I want the output to be '2013-01-01','2013-01-02'
if there is only 1 entry then there should not be any comma. (6 Replies)
Discussion started by: ATWC
6 Replies
7. Shell Programming and Scripting
Hi,
How can we remove the comma from the end of each line.
I have a csv file in below format.
file.csv
Name,age,gender,location,
Joel,18,M,Newyork,
Monoj,21,M,Japan,
Litu,23,M,turki,
Expected o/p
file1.csv
Name,age,gender,location (4 Replies)
Discussion started by: Litu19
4 Replies
8. UNIX for Dummies Questions & Answers
Hi... I can't find my little red AWK book and it's been a long while since I've awk'd. But I need to take a CSV file and convert the first word of the fifth field to its own field by replacing a space with a comma.
This is for importing a spreadsheet of issues into JIRA...
Example:
a line... (9 Replies)
Discussion started by: Tawpie
9 Replies
9. Shell Programming and Scripting
Hi,
I've got this output:
# cat test2.txt
TM1ITP1-TMNLSTP1 SLC00=0,SLC01=0,SLC02=0,SLC03=0
if I just use cat test2.txt | tr "," "\n" I'll end up very near to what I'm trying to achieve:
TM1ITP1-TMNLSTP1 SLC00=0
SLC01=0
SLC02=0
SLC03=0
But how can i eventually add the term... (1 Reply)
Discussion started by: nms
1 Replies
10. Shell Programming and Scripting
I have several line in a text file. for example
I like apple;
I like apple
I like orange;
Output: I like apple
I try to useif grep -q "!\;$"; then (Not work)
Please use CODE tags when displaying sample input, sample output, and code segments (as required by forum rules). (1 Reply)
Discussion started by: cmdcmd
1 Replies
LEARN ABOUT DEBIAN
lgfile
LGFILE(5) BP configuration files LGFILE(5)
NAME
lgfile - ION Load/Go source file
DESCRIPTION
The ION Load/Go system enables the execution of ION administrative programs at remote nodes:
The lgsend program reads a Load/Go source file from a local file system, encapsulates the text of that source file in a bundle, and
sends the bundle to a designated DTN endpoint on the remote node.
An lgagent task running on the remote node, which has opened that DTN endpoint for bundle reception, receives the extracted payload of
the bundle -- the text of the Load/Go source file -- and processes it.
Load/Go source file content is limited to newline-terminated lines of ASCII characters. More specifically, the text of any Load/Go source
file is a sequence of line sets of two types: file capsules and directives. Any Load/Go source file may contain any number of file
capsules and any number of directives, freely intermingled in any order, but the typical structure of a Load/Go source file is simply a
single file capsule followed by a single directive.
Each file capsule is structured as a single start-of-capsule line, followed by zero or more capsule text lines, followed by a single end-
of-capsule line. Each start-of-capsule line is of this form:
[file_name
Each capsule text line can be any line of ASCII text that does not begin with an opening ([) or closing (]) bracket character.
A text line that begins with a closing bracket character (]) is interpreted as an end-of-capsule line.
A directive is any line of text that is not one of the lines of a file capsule and that is of this form:
!directive_text
When lgagent identifies a file capsule, it copies all of the capsule's text lines to a new file named file_name that it creates in the
current working directory. When lgagent identifies a directive, it executes the directive by passing directive_text to the pseudoshell()
function (see platform(3)). lgagent processes the line sets of a Load/Go source file in the order in which they appear in the file, so the
directive_text of a directive may reference a file that was created as the result of processing a prior file capsule line set in the same
source file.
Note that lgfile directives are passed to pseudoshell(), which on a VxWorks platform will always spawn a new task; the first argument in
directive_text must be a symbol that VxWorks can resolve to a function, not a shell command. Also note that the arguments in
directive_text will be actual task arguments, not shell command-line arguments, so they should never be enclosed in double-quote characters
("). However, any argument that contains embedded whitespace must be enclosed in single-quote characters (') so that pseudoshell() can
parse it correctly.
EXAMPLES
Presenting the following lines of source file text to lgsend:
[cmd33.bprc
x protocol ltp
]
!bpadmin cmd33.bprc
should cause the receiving node to halt the operation of the LTP convergence-layer protocol.
SEE ALSO
lgsend(1), lgagent(1), platform(3)
perl v5.14.2 2012-05-25 LGFILE(5)