Questions tagged [line-numbers]

The line number (position) of a line of text or code inside a file, often for debugging.

369 questions
390
votes
19 answers

How to make phpstorm display line numbers by default?

How to make phpstorm display line numbers by default? Couldn't find that option. It's kind of annoying to turn them on manually for each page.
domino
  • 7,271
  • 12
  • 36
  • 48
388
votes
9 answers

vim line numbers - how to have them on by default?

I can :set number from within a file I'm editing but how can I have them always be on by default?
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
342
votes
8 answers

Delete specific line number(s) from a text file using sed?

I want to delete one or more specific line numbers from a file. How would I do this using sed?
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
228
votes
19 answers

Number of lines in a file in Java

I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file I was wondering if there is a smarter way to do that
Mark
  • 10,754
  • 20
  • 60
  • 81
164
votes
15 answers

Enable the display of line numbers in Visual Studio

Why doesn't Visual Studio have any way of showing line numbers in a source file? Is there any way to enable it, or a plugin for it? I know that the number of lines of code in a program doesn't matter, but sometimes it is nice to know how long a…
Cyclone
  • 17,939
  • 45
  • 124
  • 193
163
votes
7 answers

How do I get the current line number?

Here is an example of what I want to do: MessageBox.Show("Error line number " + CurrentLineNumber); In the code above the CurrentLineNumber, should be the line number in the source code of this piece of code. How can I do that?
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
154
votes
8 answers

Display lines number in Stack Trace for .NET assembly in Release mode

Is there a way to display the lines in the stack trace for the .NET assembly build/deployed in Release mode? UPDATE: My application is divided into three class library projects and one ASP.NET "website" project. The error I am trying to track down…
Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231
142
votes
10 answers

C/C++ line number

In the sake of debugging purposes, can I get the line number in C/C++ compilers? (standard way or specific ways for certain compilers) e.g if(!Logical) printf("Not logical value at line number %d \n",LineNumber); // How to get LineNumber…
Betamoo
  • 14,964
  • 25
  • 75
  • 109
130
votes
11 answers

How can I determine the current line number in JavaScript?

Does JavaScript have a mechanism for determining the line number of the currently executing statement (and if so, what is it)?
Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
129
votes
12 answers

Git diff with line numbers (Git log with line numbers)

When I do a git diff or a git log -p, how do I get line numbers of the source file(s) inlined with the output? I tried to look it up man git-diff | grep "line numbers" and I tried googling but got nothing quickly.
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106
77
votes
8 answers

How to add line numbers to range of lines in Vim?

How can I add line numbers to a range of lines in a file opened in Vim? Not as in :set nu—this just displays line numbers—but actually have them be prepended to each line in the file?
dkretz
  • 37,399
  • 13
  • 80
  • 138
70
votes
7 answers

Debugging: Get filename and line number from which a function is called?

I'm currently building quite a complex system in Python, and when I'm debugging I often put simple print statements in several scripts. To keep an overview I often also want to print out the file name and line number where the print statement is…
kramer65
  • 50,427
  • 120
  • 308
  • 488
57
votes
5 answers

Emacs shortcut to go to a specific line in a file

I'm learning Emacs after over two years of using Notepad++ as my default editor. I'm still hung up on a few things, but I find myself kind of enjoying working with it. My question is simple: in Notepad++, when I wanted to go to a specific line of my…
Nekkoru
  • 1,145
  • 2
  • 12
  • 18
48
votes
0 answers

Number of lines from XCode project

Possible Duplicate: How to find out how many lines of code there are in an Xcode project? I was wondering if there is anyway to count the total number of code lines from an XCode project.
Leonardo Marques
  • 3,721
  • 7
  • 36
  • 50
44
votes
6 answers

Unix Command to get the count of lines in a csv file

Hi I am new to UNIX and I have to get the count of lines from incoming csv files. I have used the following command to get the count. wc -l filename.csv Consider files coming with 1 record iam getting some files with * at the start and for those…
Devoloper250
  • 753
  • 2
  • 8
  • 12
1
2 3
24 25