Questions tagged [line-numbers]

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

369 questions
0
votes
0 answers

Hex values instead of line numbers in the stack trace

I am trying to debug a Java program loaded to an embedded system by reading the output via serial port. When an exception is raised I cannot see line numbers in the stack trace. Instead there are some hexadecimal values. I suspect that maybe they…
Limbo Exile
  • 1,321
  • 2
  • 21
  • 41
0
votes
1 answer

C# Need help editing my line numbering code

I got a code for line numbering, it works perfectly fine for numbering lines the regular way but I'm looking for something a little bit different. I want my code to only count line breaks when i press enter(the program receives an return keycode)…
Pelle Nilsson
  • 19
  • 1
  • 4
0
votes
2 answers

Print in a log file the line number

I'm trying to manage some non-standard error in my functions (like a wrong input text), and I want to track those errors by writing a sort of log in a variable. I'm trying to write also the line number, and this is my code $someVar = "line…
Naigel
  • 9,086
  • 16
  • 65
  • 106
0
votes
2 answers

wxPython StyledTextCtrl line numbers not starting at 1

I know how to add line numbers to a wxPython StyledTextCtrl, thanks to the wxPython Demos. myctrl.SetMarginType(0, wx.stc.STC_MARGIN_NUMBER) Is there a way to make the line numbering start at something other than 1? The motivation for this is to…
jkitchen
  • 900
  • 11
  • 16
0
votes
1 answer

Combining a line counter method with a word counting method

I have a method that counts the occurrences of words in a text file, and returns the number of time the word is found on a particular line. However, it doesn't keep track of which line number the words are located. i have a separate method that…
user1660948
  • 59
  • 1
  • 5
0
votes
2 answers

Unhandled Exception error line and source function

I am using VS2012 VB.net. Can I please have some help in creating some code to calculate the error line of an exception and also the function that the exception occurred in. Here is my current code: Partial Friend Class MyApplication Public…
0
votes
3 answers

How do I print each element of a list on individual lines, preceded by the line number in python?

How can I print each individual element of a list on separate lines, with the line number of the element printed before the element? The list information will also be retrieved from a text file. So far I have, import sys with open(sys.argv[1], 'rt')…
user1825241
  • 846
  • 4
  • 9
  • 17
0
votes
1 answer

Detect code line of parameter string

I want to have a method to quickly dump detailed information to a log. It'll be something like this: public static void log(String message, Class sourceClass){ dump(formattedTime+sourceClass.getName()+"line"+lineNumberfromwhichthemessagecomes…
0
votes
3 answers

Control the execution of a java program from my java program

public class LineNum1 extends Thread{ public synchronized void run() { try { Hello.main(null); System.out.println("Stack Trace of thread"+ this.currentThread().getName()); …
Daanish
  • 1,061
  • 7
  • 18
  • 29
0
votes
1 answer

Get line number of called function C

Is there a way to get the line number a function was called on in C without doing anything like below? The define can make it tedious after a while, having to use DP instead of { like usual, and hard to read; but the adding LINE as the first…
Andrew
  • 1
  • 1
0
votes
1 answer

In Eclipse, how can I figure out how many executable lines of code I have?

I wrote a fairly large program using Eclipse. I'd like to brag a bit about my 920 lines of code, but that's not a realistic number. Is there a way I can figure out the total number of executable lines (ignoring carriage return, comments, and perhaps…
rphello101
  • 1,671
  • 5
  • 31
  • 59
0
votes
1 answer

C Error - What does the number stand for?

I couldn't find anything on this, but probably its just because I don't know how to search, because i don't know how to call it. I tried to compile some C-Code and got the following error: /path/to/file.h:55:32: error: path/to/include.h: No such…
marty bourque
  • 734
  • 4
  • 7
  • 20
0
votes
2 answers

Using LineNumberReader Class to display line/word/#line

We are suppose to create a method that • The number of lines in the file • The number of words in the file, and • The number of characters in the file excluding blanks. i.e File: xxx.txt has 120 lines, 317 words, 4154 characters • Search…
user1444775
  • 71
  • 1
  • 1
  • 6
-1
votes
2 answers

Discrepency between line numbers from nl and tail

When using the following command: nl /etc/snort/snort.conf | grep output I get the following output: 33 # 6) Configure output plugins 445 # Step #6: Configure output plugins 450 # output unified2: filename snort.log, limit 128,…
RossAlexander
  • 423
  • 3
  • 10
-1
votes
3 answers

How to keep certain line numbers and delete the rest

Using sed I know how to delete certain line numbers like sed -i.bak -e '6d;8d;15d;' file How can I achieve the reverse of it. I want to keep those lines and delete the rest. I want to do this in place, as I have huge files and I'd use this as part…
RAVI
  • 53
  • 1
  • 6
1 2 3
24
25