Sponsored Content
Top Forums UNIX for Advanced & Expert Users Add line numbers to end of each line Post 302201937 by rudoraj on Tuesday 3rd of June 2008 11:55:07 AM
Old 06-03-2008
Works fine.
thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

add line numbers

Hello.. I have got one file ... I want to add line numbers with space form starting to ending.. for example...if the file is -------------------------- sand sorcd 2345 345 recds 234 234 5687 yeres 568 988 erfg4 67 -------------------------- I need the output ... (4 Replies)
Discussion started by: esham
4 Replies

2. Shell Programming and Scripting

Add a new end of line

Hi, Does anyone know if its possible to add something like an end of line like c or java in unix? dirs=/home/nosnam var='' for dir in $dirs do listDirs=`ls -d1 $dir/*` for eachList in $listDirs do listRepos=`du -ks $eachList | awk '{ x+=$1 }; END { print x... (4 Replies)
Discussion started by: nosnam
4 Replies

3. Solaris

Need help capturing end of line numbers

Hello All, Currently I am attempting to write a script which will capture a number at the end of a line. The line which I am searching through ends as follows: word word=number for example word word=3 OR word word=15 I am stuck on how to capture whatever is to the right... (3 Replies)
Discussion started by: icalderus
3 Replies

4. Shell Programming and Scripting

how to add ; at the end of last line

hi, i have file which is having large sql query eg : i am executing this sql file but now i want to add ; after query on same line i.e. i should look like any idea how to achieve it ? (6 Replies)
Discussion started by: crackthehit007
6 Replies

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

6. Shell Programming and Scripting

Adding patterns with increasing numbers at the end of every line

Hi All, I have a file which has some Linux commands in every line like more 456.dat more 3232.dat more 433.dat I want to add texts like this at the end of every line: more 456.dat > 1.txt more 3232.dat > 2.txt more 433.dat > 3.txt So, that the result of more goes into 1.txt... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

7. UNIX for Dummies Questions & Answers

Grep lines with numbers greater than 2 digits at the end of the line

I'm trying to grep lines where the digits at the end of each line are greater than digits. Tried this but it will only allow me to specify 2 digits. Any ideas would greatly be appreciated. grep -i '\<\{3,4,5\}\>' file ---------- Post updated at 05:58 PM ---------- Previous update was at 05:41... (1 Reply)
Discussion started by: jimmyf
1 Replies

8. Shell Programming and Scripting

Add line at the end

How to add a comma at the end of each line in this file?30 1412 30 3352 30 5254 30 5543 30 7478 3 28 3 30 3 39 3 54 3 108 3 152 3 178 3 182 3 214 3 271 3 286 3 300 3 348 3 349 3 371 (3 Replies)
Discussion started by: gunjan
3 Replies

9. Shell Programming and Scripting

How to add a character at end of line?

Hai, I have got a small requirement in my script. and i am using bash shell. I need to add a dot (.) for some particular line in a file. Say for example, $Cat rmfile 1 This is line1 2 This is line2 3 This is line3 O/p should be : $Cat rmfile 1 This is line1 2 This is line2. #... (2 Replies)
Discussion started by: Sivajee
2 Replies

10. Red Hat

How to add a new string at the end of line by searching a string on the same line?

Hi, I have a file which is an extract of jil codes of all autosys jobs in our server. Sample jil code: ************************** permission:gx,wx date_conditions:yes days_of_week:all start_times:"05:00" condition: notrunning(appDev#box#ProductLoad)... (1 Reply)
Discussion started by: raghavendra
1 Replies
gets(n) 						       Tcl Built-In Commands							   gets(n)

__________________________________________________________________________________________________________________________________________________

NAME
gets - Read a line from a channel SYNOPSIS
gets channelId ?varName? _________________________________________________________________ DESCRIPTION
This command reads the next line from channelId, returns everything in the line up to (but not including) the end-of-line character(s), and discards the end-of-line character(s). ChannelId must be an identifier for an open channel such as the Tcl standard input channel (stdin), the return value from an invocation of | open or socket, or the result of a channel creation command provided by a Tcl extension. The channel must have been opened for input. If varName is omitted the line is returned as the result of the command. If varName is specified then the line is placed in the variable by that name and the return value is a count of the number of characters returned. If end of file occurs while scanning for an end of line, the command returns whatever input is available up to the end of file. If chan- nelId is in nonblocking mode and there is not a full line of input available, the command returns an empty string and does not consume any input. If varName is specified and an empty string is returned in varName because of end-of-file or because of insufficient data in non- blocking mode, then the return count is -1. Note that if varName is not specified then the end-of-file and no-full-line-available cases can produce the same results as if there were an input line consisting only of the end-of-line character(s). The eof and fblocked commands can be used to distinguish these three cases. SEE ALSO
file(n), eof(n), fblocked(n), Tcl_StandardChannels(3) KEYWORDS
blocking, channel, end of file, end of line, line, nonblocking, read Tcl 7.5 gets(n)
All times are GMT -4. The time now is 07:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy