0

hello all
is there available code to remove line numbers in front of each line
of a text file

thank you
denny

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by adarshcu
0
Scanner scanner = new Scanner(myFileWithLineNumbers);
  while(scanner.hasNextLine()){
	String line = scanner.nextLine();
	line.substring(1, line.length());
	}

This is one such small snippet of code.

Assuming you have single digit numbers. There will be variations when you try to add this in your code fully. May be your line number has a "." at its end which you can use to delimit and separate.

Edited by adarshcu: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.