Sponsored Content
Full Discussion: adding line terminator
Top Forums UNIX for Dummies Questions & Answers adding line terminator Post 63324 by thanuman on Thursday 24th of February 2005 06:38:16 AM
Old 02-24-2005
adding line terminator

Can someone help , how to add a terminator at the end of each line through shell command.
ex:
input file:
abc
xyz2

outputfile (terminator is !)
abc!
xyz2!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Line Terminator

Hi Guys, This is Narasa i am new to this forum.I am very proud to join this forum. I have a question on Line termination for fixed length file. We got a file from mainframe having fixed length of 587 but when i extract the zip file with notepad it looks like continuous line with out any... (3 Replies)
Discussion started by: narasa
3 Replies

2. Shell Programming and Scripting

Fill the empty line by adding line before blank line

FIle A "A" 2 aa 34 3 ac 5 cd "B" 3 hu 67 4 fg 5 gy output shud be A"" 2 aa 34 "A" 3 ac 34 "A" 5 cd 34 "B" 3 hu 67 "B" 4 fg 67 "B" 5 gy 67 (6 Replies)
Discussion started by: cdfd123
6 Replies

3. UNIX for Dummies Questions & Answers

Adding a line feed to each line

Hi folks, I did a search on this and didn't really find what fit my needs. I have a file with fixed record length of 436 bytes. I want to add a line feed x"0A" to the end x"0A" of each record(in byte 437). What's the easiest way to accomplish this? Thanks. (5 Replies)
Discussion started by: keeferb
5 Replies

4. Shell Programming and Scripting

adding characters end of line where line begins with..

Hi all, using VI, can anyone tell me how to add some characters onto the end of a line where the line begins with certain charactars eg a,b,c,......., r,s,t,........, a,b,c,......., all lines in the above example starting with a,b,c, I want to add an x at the end of the line so the... (6 Replies)
Discussion started by: satnamx
6 Replies

5. Shell Programming and Scripting

Adding a blank line after every 5th line

Hello... I have a file which contain certain number of records. I want to generate another file from this file which will contain 1st line as a blank line & after every 5 lines one blank line will be inserted. How to achieve this through shell scripting? Thanks... (5 Replies)
Discussion started by: 46019
5 Replies

6. Shell Programming and Scripting

Adding tab/new line at the end of each line of a file

Hello Everyone, I need a help from experts of this community regarding one of the issue that I am facing with shell scripting. My requirement is to append char's at the end of each line of a file. The char that will be appended is variable and will be passed through command line. The... (20 Replies)
Discussion started by: Sourav Das
20 Replies

7. Shell Programming and Scripting

Record terminator on alternate line

Hello All, I have csv file like this 1,"suzi","305 Barehills","Vancover",34256 2,"molly","456 beverleyhills","Minisotta",234876 I want to put a customized record terminator on every alternate lines of this file. The file is a input to database and the record terminator is by default... (3 Replies)
Discussion started by: nnani
3 Replies

8. 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

9. Shell Programming and Scripting

Adding line in a file using info from previous line

I have a shell script that looks something like the following: mysql -uroot db1 < db1.sql mysql -uroot db2 < db2.sql mysql -uroot db3 < db3.sql mysql -uroot db4 < db4.sql .... different db names in more than 160 lines. I want to run this script with nohup and have a status later. So,... (6 Replies)
Discussion started by: MKH
6 Replies

10. UNIX for Beginners Questions & Answers

Adding a new line after a specific line with sed

Hi All, My requirement is to add a specific line in a file after a certain line that contains 'setenv' the existing code is like setenv SEQFILES "/ConvWrk/inteng03/alltars/bnymais1" LIBDEF scope='JOB' type='PGM' dataset='SUNAR.PJ90000P.JOBLIB'... (5 Replies)
Discussion started by: gotamp
5 Replies
XmTextGetSubstring(library call)										  XmTextGetSubstring(library call)

NAME
XmTextGetSubstring -- A Text function that retrieves a copy of a portion of the internal text buffer SYNOPSIS
#include <Xm/Text.h> int XmTextGetSubstring( Widget widget, XmTextPosition start, int num_chars, int buffer_size, char *buffer); DESCRIPTION
XmTextGetSubstring retrieves a copy of a portion of the internal text buffer of a Text widget. The function copies a specified number of characters from a given start position in the internal text buffer into a buffer provided by the application. A NULL terminator is placed at the end of the copied data. The size of the required buffer depends on the maximum number of bytes per character (MB_CUR_MAX) for the current locale. MB_CUR_MAX is a macro defined in stdlib.h. The buffer should be large enough to contain the substring to be copied and a NULL terminator. Use the following equation to calculate the size of buffer the application should provide: buffer_size = (num_chars* MB_CUR_MAX) + 1 (void) widget Specifies the Text widget ID. start Specifies the beginning character position from which the data will be retrieved. This is an integer number of characters from the beginning of the text buffer. The first character position is 0 (zero). num_chars Specifies the number of characters to be copied into the provided buffer. buffer_size Specifies the size of the supplied buffer in bytes. This size should account for a NULL terminator. buffer Specifies the character buffer into which the internal text buffer will be copied. For a complete definition of Text and its associated resources, see XmText(3). RETURN
XmCOPY_SUCCEEDED The function was successful. XmCOPY_FAILED The function failed because it was unable to copy the specified number of characters into the buffer provided. The buffer size may be insufficient. The contents of buffer are undefined. XmCOPY_TRUNCATED The requested number of characters extended beyond the internal buffer. The function copied characters between start and the end of the widget's buffer and terminated the string with a NULL terminator; fewer than num_chars characters were copied. RELATED
XmText(3) and XmTextGetSubstringWcs(3). XmTextGetSubstring(library call)
All times are GMT -4. The time now is 07:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy