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
6
votes
5 answers

Ruby - How to skip/ignore specific lines when reading a file?

What's the best approach for ignoring some lines when reading/parsing a file (using Ruby)? I'm trying to parse just the Scenarios from a Cucumber .feature file and would like to skip lines that doesn't start with the words…
user2253130
  • 589
  • 2
  • 5
  • 14
6
votes
1 answer

how to select multiple lines in iphone .plist file?

In my Iphone application ,i am using .plist file having so many data. I want to select multiple lines in .plist file. Please give any key combination by using which i can select multiple lines in .plist file and also use it for my own…
Developer
  • 1,009
  • 8
  • 25
  • 56
6
votes
3 answers

sed: conditional merge of multiple lines

I need to merge line of a file using sed based on a pattern. eg: Input File: X1 A B C D E F \+ G H I J 1 \+ LK T PP E OO 2 X2 DDF F Y \+ J W Q .... OutPut Expected: X1 A B C D E F G H I J 1 LK T PP E OO 2 X2 DDF F Y J W Q .. I would…
user1495523
  • 475
  • 2
  • 7
  • 17
5
votes
2 answers

Android - SQLiteStatement (multiple insert) execute fails with API Level 14

I use the following code to insert new lines efficiently in a DB : @Override public void insertImpacts(HolderExpense expense, int[] shares, int[] amounts, HolderUser[] users) { try { mDb.beginTransaction(); // the insertion of the…
Gilbou
  • 5,244
  • 6
  • 24
  • 27
5
votes
4 answers

Read in lines in a text file, sort, then overwrite file

I am trying to write a go function that will read in lines in a text file, sort them (alphabetize), and overwrite them back to the file. Right now, I am able to essentially emulate cat, but I can't seem to be able to manipulate the contents of the…
rick
  • 1,075
  • 4
  • 20
  • 29
5
votes
1 answer

How to find N longest lines in a text file and print them to stdout?

The first line contains the value of the number 'N' followed by multiple lines. I could solve it in order of n^2 algorithm. Can someone suggest a better one?
rkt
  • 1,171
  • 2
  • 9
  • 18
5
votes
7 answers

Remove Duplicate Lines from Text using Java

I was wondering if anyone has logic in java that removes duplicate lines while maintaining the lines order. I would prefer no regex solution.
MatBanik
  • 26,356
  • 39
  • 116
  • 178
5
votes
6 answers

How to break a string in lines

I'm confused with what is the correct way to break lines. I read somewhere that windows use \r\n to break lines, but this two codes produce the same regex.split(sometext, "\r\n"); regex.split(sometext, "\n"); What it is the correct way?, these…
mjsr
  • 7,410
  • 18
  • 57
  • 83
5
votes
3 answers

Opencv HoughLines Lines Theta?

I have a question about opencv libary of HoughLines. The format is below from the official website: C++: void HoughLines(InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn=0, double stn=0 ) And the explanation…
HenryChen
  • 153
  • 3
  • 12
5
votes
3 answers

How to create Lines connecting two points in R

Is there any way to create lines in R connecting two points? I am aware of lines(), function, but it creates line segment what I am looking for is an infinite length line.
Udayan Maurya
  • 75
  • 1
  • 1
  • 5
5
votes
1 answer

Draw line from Label to point in R

I am currently trying to generate an automated script to create a labeled line graph. This line graphs will have 1 or more maxima that if they are above a certain threshold must be labeled. Currently I can label the maxima just fine. For that I am…
Cameron
  • 63
  • 8
5
votes
5 answers

How to join lines adding a separator?

The command J joins lines. The command gJ joins lines removing spaces Is there also a command to Join lines adding a separator between the lines? Example: Input: text other text more text text What I want to do: - select these 4 lines - if…
Reman
  • 7,931
  • 11
  • 55
  • 97
5
votes
2 answers

I can store only a finite number of lines in a new text file

I have many different pseudo-random number generators written in C that generate an arbitrary number of pairs of random numbers (through the CLI) and store them in a (new) text file: a pair of numbers per column. I want to store 400.000.000 numbers…
5
votes
1 answer

Google Charts: multiple lines with custom tooltips

I have a Google LineChart with multiple lines. These points do not share the same X value's so i have to format my data in a certain way to make it work: var data = google.visualization.arrayToDataTable([ ["Y", "Your X & Y", "Product 1",…
user3078654
  • 51
  • 1
  • 4
5
votes
1 answer

Add custom lines in ggplot barplot

I created this plot with this code: ggplot(data_long, aes(Trial,value,fill=factor(Trial))) + stat_summary(fun.y=mean,geom="bar") + facet_grid(Task~Gruppo) + labs(x="Trial type",y="Accuracy %") + theme(legend.position="none") Now, I…
this.is.not.a.nick
  • 2,631
  • 3
  • 21
  • 26