Questions tagged [lines]

This tag can refer to rows of characters in text output or input, or to the shortest distance between two points.

This tag can refer to:

  • rows of characters in text output or input;
  • the shortest distance between two points (see also: ).
1223 questions
41
votes
10 answers

Splitting large text file into smaller text files by line numbers using Python

I have a text file say really_big_file.txt that contains: line 1 line 2 line 3 line 4 ... line 99999 line 100000 I would like to write a Python script that divides really_big_file.txt into smaller files with 300 lines each. For example,…
walterfaye
  • 819
  • 2
  • 9
  • 15
39
votes
4 answers

Deleting the first two lines of a file using BASH or awk or sed or whatever

I'm trying to delete the first two lines of a file by just not printing it to another file. I'm not looking for something fancy. Here's my (failed) attempt at awk: awk '{ (NR > 2) {print} }' myfile That throws out the following error: awk: { NR >…
Amit
  • 7,688
  • 17
  • 53
  • 68
33
votes
5 answers

How to use Regex to move everything onto one line in notepad++

I'm trying to figure out how to use Regex to merge the contents of my text file (25 lines of data) into one line. So far, I can get Notepad++ to successfully find the lines I'm looking for by making it search for (^) , but what I'm unsure of is…
user3153443
  • 511
  • 3
  • 6
  • 13
30
votes
8 answers

Why is this C code faster than this C++ code ? getting biggest line in file

I have two versions of a program that does basically the same thing, getting the biggest length of a line in a file, I have a file with about 8 thousand lines, my code in C is a little bit more primitive (of course!) than the code I have in C++. The…
Alex
  • 2,247
  • 1
  • 27
  • 37
29
votes
8 answers

Batch / Find And Edit Lines in TXT file

I want to create a batch while which finds specific lines in a batch file and are able to edit these lines. Example: //TXT FILE// ex1 ex2 ex3 ex4 i want to let the batch file find 'ex3' and edit this to 'ex5' to let it look like…
Deniz Zoeteman
  • 9,691
  • 26
  • 70
  • 97
28
votes
6 answers

How can I repeat the line in notepad++?

How can I repeat the line in notepad++ ? For example I have the following input: a 01 a 02 a 03 a 04 And I would like it to become: a 01 a 01 a 02 a 02 a 03 a 03 a 04 a 04 So every line should be displayed twice.
tahafahed
  • 383
  • 1
  • 3
  • 7
27
votes
2 answers

Drawing lines in code using C# and WPF

I'm trying to create a digital clock display using 7 segment displays. I can draw lines in XAML by using code like this: But when I…
Jesse
  • 281
  • 1
  • 3
  • 5
27
votes
8 answers

Python - Deleting the first 2 lines of a string

I've searched many threads here on removing the first two lines of a string but I can't seem to get it to work with every solution I've tried. Here is what my string looks like: version 1.00 6992 [-4.32063, -9.1198, -106.59][0.00064, 0.99993,…
Rontron
  • 3,963
  • 7
  • 26
  • 44
26
votes
3 answers

Easiest way to "draw" simple lines over an image with jQuery and save to Rails DB?

I'd like to draw lines on an image. Basically allow the user to draw a path for mountain trails they like. 1) Does anyone know a good simple library for drawing basic lines? 2) After a user draws a bunch of lines on an image, what would be the best…
Daniel Fischer
  • 3,042
  • 1
  • 26
  • 49
25
votes
5 answers

vim limited line memory

im trying to copy 300 lines from one file to another, in source file i type "300yy", it says it has yanked 300 lines. go to destination file and press p, it pastes, but only the first 50 lines. any idea why it isn't pasting the 300?
john-jones
  • 7,490
  • 18
  • 53
  • 86
25
votes
5 answers

Finding points on a line with a given distance

I have a question i know a line i just know its slope(m) and a point on it A(x,y) How can i calculate the points(actually two of them) on this line with a distance(d) from point A ??? I m asking this for finding intensity of pixels on a line that…
Emre
  • 435
  • 1
  • 6
  • 13
23
votes
6 answers

C# How to skip number of lines while reading text file using Stream Reader?

I have a program which reads a text file and processes it to be seperated into sections. So the question is how can the program be changed to allow the program to skip reading the first 5 lines of the file while using the Stream Reader to read the…
JavaNoob
  • 3,494
  • 19
  • 49
  • 61
22
votes
1 answer

How to determine the number of lines visible in TextView?

how to get how many lines are displayed in visible part of TextView? I use text, which not fully placed in TextView on every screen resolution.
umni4ek
  • 365
  • 1
  • 2
  • 16
21
votes
1 answer

How to draw connecting lines between two controls on a grid WPF

I am creating controls (say button) on a grid. I want to create a connecting line between controls. Say you you do mousedown on one button and release mouse over another button. This should draw a line between these two buttons. Can some one help me…
Scooby
  • 635
  • 3
  • 9
  • 21
17
votes
3 answers

Show Indent Guide Lines In Xcode

Coming from a background using Visual Studio and Notepad++ I'm used to the indent guides which help to visually enhance sections of code where the curly braces are used, Xcode (No indent guides) Visual Studio (Nice tidy indent guides) As you can…
HGomez
  • 1,494
  • 8
  • 32
  • 42
1
2
3
81 82