Anyone know how to use SED to append a comma to the end of each line
example:
field1,field2,field3,field4
If i Cat /textfile ---- How can i append the end of /textfile with a comman? (8 Replies)
Hi
I need to append some text @ end of the first line in a file.
like
myfile.txt
list = a,b,c
list.a=some..
I give the arg "d" . now it append at end of first line
list=a,b,c,d
list.a=some...
Please help me out this (7 Replies)
Hello to all,
On aix, I want to identify a term on a line in a file and then add a word at the end of the line identified. I do not want the word to be added when the line contains the symbol "#".
I use the following command, but it deletes the term identified then adds the word.
#sed... (4 Replies)
Hi All,
Please tell me how to append some text message at the end of the file.
"File too large to view"
example: xyz.log contains
hhhhhhhhhhh
hhhhhhjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjj
"File too large to view"
Please advice (3 Replies)
I have a file "sample.txt" with the content as below:
Hi
This is a Sample Text.
I need a single command using cat which serve the following purpose.
1.display the contents of sample.txt
2.append some text to it
3. and then exit
But, all should be served by a sinle command.:confused: (1 Reply)
Hi all,
I have output files that are all text files with various different extensions.
So, if I submit the input file "job_name.inp", when it finishes I get an output file "job_name.dat". A typical input file looks something like this:
$CONTRL SCFTYP=RHF RUNTYP=ENERGY MAXIT=199 MULT=1... (4 Replies)
Hi,
I've spent some time researching for this but can't seem to find a solution. I have a file like this
1234|Test|20101111|18:00|19:00There will be multiple lines in the file with the same kind of format. For every line I need to make it this
1234|Test|20101111|18:00|19:00||create... (5 Replies)
I've scoured the internet with mixed results. As an amateur I turn to the great minds here.
I have a text file of 80 or so lines. I want to add ".pdf" to the end of each line. (For now that's it)
Most of the internet points toward using "sed". I don't know coding but can figure things out... (4 Replies)
Hi guys,
I have to append the word count of a file at the end of the file name like this - > "filename_2345" where 2345 is the word count of "filename". How do i achieve this using one command ? I am not allowed to store the word count in a variable and then concatenate. Request your... (1 Reply)
hello Team,
I am looking for sed command or script which will append word at end of line. for example. I want to validate particular filesystem with mount |<filesystem name> command. if nodev parameter is not there then it should add in the fstab file with receptive to the filesystem.
# mount... (8 Replies)
Discussion started by: ghpradeep
8 Replies
LEARN ABOUT FREEBSD
paste
PASTE(1) BSD General Commands Manual PASTE(1)NAME
paste -- merge corresponding or subsequent lines of files
SYNOPSIS
paste [-s] [-d list] file ...
DESCRIPTION
The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file's newline characters with a
single tab character, and writes the resulting lines to standard output. If end-of-file is reached on an input file while other input files
still contain data, the file is treated as if it were an endless source of empty lines.
The options are as follows:
-d list Use one or more of the provided characters to replace the newline characters instead of the default tab. The characters in list
are used circularly, i.e., when list is exhausted the first character from list is reused. This continues until a line from the
last input file (in default operation) or the last line in each file (using the -s option) is displayed, at which time paste
begins selecting characters from the beginning of list again.
The following special characters can also be used in list:
newline character
tab character
\ backslash character
Empty string (not a null character).
Any other character preceded by a backslash is equivalent to the character itself.
-s Concatenate all of the lines of each separate input file in command line order. The newline character of every line except the
last line in each input file is replaced with the tab character, unless otherwise specified by the -d option.
If '-' is specified for one or more of the input files, the standard input is used; standard input is read one line at a time, circularly,
for each instance of '-'.
EXIT STATUS
The paste utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
List the files in the current directory in three columns:
ls | paste - - -
Combine pairs of lines from a file into single lines:
paste -s -d '
' myfile
Number the lines in a file, similar to nl(1):
sed = myfile | paste -s -d '
' - -
Create a colon-separated list of directories named bin, suitable for use in the PATH environment variable:
find / -name bin -type d | paste -s -d : -
SEE ALSO cut(1), lam(1)STANDARDS
The paste utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
HISTORY
A paste command appeared in Version 32V AT&T UNIX.
BSD June 25, 2004 BSD