Sponsored Content
Top Forums Shell Programming and Scripting Add a comma at end of every line Post 24510 by pipin on Friday 12th of July 2002 05:55:57 PM
Old 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

Add line numbers to end of each line

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

Get the 1st 99 characters and add new line feed at the end of the line

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

Adding comma at the end of every line

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

Use sed to add comma to end of first field

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 character in end of last line of file?

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

Adding comma to end of each line if more than 1 line

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

How can we remove comma from end of each line ?

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

Add a field separator (comma) inside a line of a CSV file

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

Add previous text when replacing comma with new line

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

Shell script to check line end not ending with comma

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
DCM2NII(1)							   User Commands							DCM2NII(1)

NAME
dcm2nii - convert DICOM or PAR/REC image into the NIfTI format SYNOPSIS
dcm2nii <options> <sourcenames> OPTIONS
-a Anonymize [remove identifying information]: Y,N = Y -b load settings from specified inifile, e.g. '-b /etc/mricron.ini' -c Collapse input folders: Y,N = N -d Date in filename [filename.dcm -> 20061230122032.nii]: Y,N = Y -e events (series/acq) in filename [filename.dcm -> s002a003.nii]: Y,N = Y -f Source filename [e.g. filename.par -> filename.nii]: Y,N = Y -g gzip output, filename.nii.gz [ignored if '-n n']: Y,N = Y -i ID in filename [filename.dcm -> johndoe.nii]: Y,N = Y -n output .nii file [if no, create .hdr/.img pair]: Y,N = Y -o Output Directory, e.g. '/tmp' (if unspecified, source directory is used) -p Protocol in filename [filename.dcm -> TFE_T1.nii]: Y,N = Y -r Reorient image to nearest orthogonal: Y,N -s SPM2/Analyze not SPM5/NIfTI [ignored if '-n y']: Y,N = N -v Convert every image in the directory: Y,N = Y -x Reorient and crop 3D NIfTI images: Y,N = N You can also set defaults by editing /home/michael/.dcm2nii/dcm2nii.ini EXAMPLES
dcm2nii -a y /home/joe/Documents/dcm/IM_0116 AUTHOR
dcm2nii was written by Chris Rorden. This manual page was written by Michael Hanke <michael.hanke@gmail.com>, for the Debian project (but may be used by others). SEE ALSO
mricron(1) MRIcron Homepage: http://www.cabiatl.com/mricro/mricron/ Michael Hanke April 2010 DCM2NII(1)
All times are GMT -4. The time now is 11:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy