Sponsored Content
Full Discussion: Auto generate Line Numbers
Top Forums Shell Programming and Scripting Auto generate Line Numbers Post 302782365 by djehresmann on Monday 18th of March 2013 04:12:49 PM
Old 03-18-2013
Auto generate Line Numbers

How do I generate line numbers in Vi?

I have this:


Code:
,'04-90020-039N','61423','2GDV00039-0002', SYSDATE);
,'04-90020-040D','61423','2GDV00046-0001', SYSDATE);
,'04-90020-041N','61423','2GDV00038-0002', SYSDATE);
,'04-90020-043D','61423','2GDV00047-0001', SYSDATE);
,'04-90020-044D','73168','2GDV00071-0002', SYSDATE);
,'0453-941-110','1DJ82','0453-941-110', SYSDATE);
,'0456-931-110-01','1DJ82','0456-931-110-01', SYSDATE);
,'0456-933-111','1DJ82','0456-933-111', SYSDATE);
,'0N687022-509','11447','2ZKH85070-0005', SYSDATE);
,'1000538','83330','1000538', SYSDATE);

And I want to put a line number in front of the line. This goes on for 23k+ lines.

Code:
1,'04-90020-039N','61423','2GDV00039-0002', SYSDATE);
2,'04-90020-040D','61423','2GDV00046-0001', SYSDATE);
3,'04-90020-041N','61423','2GDV00038-0002', SYSDATE);
4,'04-90020-043D','61423','2GDV00047-0001', SYSDATE);
5,'04-90020-044D','73168','2GDV00071-0002', SYSDATE);
6,'0453-941-110','1DJ82','0453-941-110', SYSDATE);
7,'0456-931-110-01','1DJ82','0456-931-110-01', SYSDATE);
8,'0456-933-111','1DJ82','0456-933-111', SYSDATE);
9,'0N687022-509','11447','2ZKH85070-0005', SYSDATE);
10,'1000538','83330','1000538', SYSDATE);


thanks.
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 03-18-2013 at 06:49 PM.. Reason: code tags, please!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

generate level numbers

Hi... I have a sequence of jobs and its predecessors.. Input Job_Name Predecessor A NULL B1 A B2 A B3 B1 C B3 C B2 So based on these i have to generate the level Number What i mean is Let A be level 1 for B1 to happen it should have done A so B1 level is A+1 = 1+1 = 2 (12 Replies)
Discussion started by: pbsrinivas
12 Replies

2. Shell Programming and Scripting

How to generate a series of numbers

Hi All, I have a requirement where in I have an input as follows:- input=1-4,6,8-10,12-15 I need to explode this range into an output file as follows:- 1 2 3 4 6 8 9 10 12 13 14 15 My input may vary like 1,5-9,11-13,15-17....... (3 Replies)
Discussion started by: rony_daniel
3 Replies

3. Shell Programming and Scripting

shell script to auto process ten random files and generate logs

Hello member's I'm learning to script in the ksh environment on a Solaris Box. I have 10 files in a directory that I need to pass, as input to a batch job one by one. lets say, the files are named as follows: abcd.txt ; efgh.bat ; wxyz.temp etc. (random filenames with varied extensions ).... (1 Reply)
Discussion started by: novice82
1 Replies

4. UNIX for Dummies Questions & Answers

auto generate ID

Using 'awk' i want to generate new ID..which should be increment of maximum number given as UID.. eg..in /etc/passwd..3rd field is UID..and we just want next user ID for this file..keep in mind that file is not sorted..so last line in the file may not display last UID..means UIDs in file are... (1 Reply)
Discussion started by: aadi_uni
1 Replies

5. Shell Programming and Scripting

How to Auto Generate pg_hba.conf file at Startup

Hi there, I'll start by letting you you know my current shell programming and scripting is very week (and thats a euphemistic description). I'm really just wanting someone to make a suggestion to get me rolling in the right direction though absolutely any help is of course welcome. Set Up -... (0 Replies)
Discussion started by: lukusc
0 Replies

6. Shell Programming and Scripting

How to generate 10.000 unique numbers?

hello, does anybody can give me a hint on how to generate a lot of numbers which are not identically via scripting etc? (7 Replies)
Discussion started by: xrays
7 Replies

7. Shell Programming and Scripting

Generate numbers 000 to 999

I have tried to make this script to generate: 000 001 002 ... 997 998 999 i=0 while do if then echo "00"$i else if && then echo "0"$i (5 Replies)
Discussion started by: locoroco
5 Replies

8. Programming

generate array of random numbers

hi guys, I am writing a c program that generates a two dimensional array to make matrix and a vector of random numbers and perform multiplication. I can't figure out whats wrong with my code. It generates a matrix of random numbers but all the numbers in the vector array is same and so is the... (2 Replies)
Discussion started by: saboture88
2 Replies

9. Shell Programming and Scripting

Generate random numbers in script

i want to generate a random number through a script, and even if anyone reads the script, they wont be able to figure out what the random number is. only the person who setup the script would know it. something like this could work: random the full thread is here: ... (13 Replies)
Discussion started by: SkySmart
13 Replies

10. Shell Programming and Scripting

Script to generate sequence of numbers

I need awk script to generate part number sequencing based on data in multiple columns like below Input File --------- Col A|Col B|Col C| 1|a|x| 2|b|y| |c|z| | |m| | |n| And out put should be like 1ax 1ay 1az 1am 1an 1bx 1by (6 Replies)
Discussion started by: aramacha
6 Replies
Alzabo::SQLMaker::MySQL(3pm)				User Contributed Perl Documentation			      Alzabo::SQLMaker::MySQL(3pm)

NAME
Alzabo::SQLMaker::MySQL - Alzabo SQL making class for MySQL SYNOPSIS
use Alzabo::SQLMaker; my $sql = Alzabo::SQLMaker->new( sql => 'MySQL' ); DESCRIPTION
This class implementes MySQL-specific SQL creation. MySQL does not allow subselects. Any attempt to use a subselect (by passing an "Alz- abo::SQMaker" object in as parameter to a method) will result in an "Alzabo::Exception::SQL" error. METHODS
Almost all of the functionality inherited from Alzabo::SQLMaker is used as is. The only overridden methods are "limit()" and "get_limit()", as MySQL does allow for a "LIMIT" clause in its SQL. EXPORTED SQL FUNCTIONS
SQL may be imported by name or by tags. They take arguments as documented in the MySQL documentation (version 3.23.39). The functions (organized by tag) are: :math PI RAND MOD ROUND POW POWER ATAN2 ABS SIGN FLOOR CEILING EXP LOG LOG10 SQRT COS SIN TAN ACOS ASIN ATAN COT DEGREES RADIANS TRUNCATE :string CHAR POSITION INSTR LEFT RIGHT FIND_IN_SET REPEAT LEAST GREATEST CONCAT ELT FIELD MAKE_SET LOCATE SUBSTRING CONV LPAD RPAD MID SUBSTRING_INDEX REPLACE CONCAT_WS EXPORT_SET INSERT ASCII ORD BIN OCT HEX LENGTH OCTET_LENGTH CHAR_LENGTH CHARACTER_LENGTH TRIM LTRIM RTRIM SOUNDEX SPACE REVERSE LCASE LOWER UCASE UPPER :datetime CURDATE CURRENT_DATE CURTIME CURRENT_TIME NOW SYSDATE CURRENT_TIMESTAMP UNIX_TIMESTAMP WEEK PERIOD_ADD PERIOD_DIFF DATE_ADD DATE_SUB ADDDATE SUBDATE DATE_FORMAT TIME_FORMAT FROM_UNIXTIME DAYOFWEEK WEEKDAY DAYOFYEAR MONTH DAYNAME MONTHNAME QUARTER YEAR YEARWEEK HOUR MINUTE SECOND TO_DAYS FROM_DAYS SEC_TO_TIME TIME_TO_SEC :aggregate These are functions which operate on an aggregate set of values all at once. COUNT AVG MIN MAX SUM STD STDDEV :system These are functions which return information about the MySQL server. DATABASE USER SYSTEM_USER SESSION_USER VERSION CONNECTION_ID LAST_INSERT_ID GET_LOCK RELEASE_LOCK BENCHMARK MASTER_POS_WAIT :control These are flow control functions: IFNULL NULLIF IF :misc These are functions which don't fit into any other categories. ENCRYPT ENCODE DECODE FORMAT INET_NTOA INET_ATON BIT_OR BIT_AND PASSWORD MD5 LOAD_FILE :fulltext These are functions related to MySQL's fulltext searching capabilities. MATCH AGAINST IN_BOOLEAN_MODE NOTE: In MySQL 4.0 and greater, it is possible to say that a search is in boolean mode in order to change how MySQL handles the argument given to AGAINST. This will not work with earlier versions. :common These are functions from other groups that are most commonly used. NOW COUNT AVG MIN MAX SUM DISTINCT AUTHOR
Dave Rolsky, <dave@urth.org> perl v5.8.8 2007-12-23 Alzabo::SQLMaker::MySQL(3pm)
All times are GMT -4. The time now is 06:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy