Questions tagged [skip]

Skipping is a construct that manipulates iteration (for, while, do-while).

Skipping is a construct that manipulates iteration (for, while, do-while).

For example in Java there are three skip constructs:

  1. break which is skip the processing remaining loops.
  2. continue which is skip only remaining steps in the current loop.
  3. go to which skip all steps from current step to destination step.

While Oracle Service Bus has two:

  1. Resume will skip current stage and continue to process next stage.
  2. Reply will skip remaining stages.
721 questions
766
votes
13 answers

Print a file, skipping the first X lines, in Bash

I have a very long file which I want to print, skipping the first 1,000,000 lines, for example. I looked into the cat man page, but I did not see any option to do this. I am looking for a command to do this or a simple Bash program.
Eduardo
  • 19,928
  • 23
  • 65
  • 73
121
votes
2 answers

How do you skip a unit test in Django?

How do forcibly skip a unit test in Django? @skipif and @skipunless is all I found, but I just want to skip a test right now for debugging purposes while I get a few things straightened out.
user798719
  • 9,619
  • 25
  • 84
  • 123
84
votes
9 answers

Skip first couple of lines while reading lines in Python file

I want to skip the first 17 lines while reading a text file. Let's say the file looks like: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 good stuff I just want the good stuff. What I'm doing is a lot more complicated, but this is the part I'm having trouble…
O.rka
  • 29,847
  • 68
  • 194
  • 309
76
votes
11 answers

java foreach skip first iteration

Is there an elegant way to skip the first iteration in a Java5 foreach loop ? Example pseudo-code: for ( Car car : cars ) { //skip if first, do work for rest . . }
Amir Afghani
  • 37,814
  • 16
  • 84
  • 124
68
votes
5 answers

Java 8 Stream: difference between limit() and skip()

Talking about Streams, when I execute this piece of code public class Main { public static void main(String[] args) { Stream.of(1,2,3,4,5,6,7,8,9) .peek(x->System.out.print("\nA"+x)) .limit(3) …
Luigi Cortese
  • 10,841
  • 6
  • 37
  • 48
60
votes
3 answers

LINQ: How to skip one then take the rest of a sequence

i would like to iterate over the items of a List, except the first, preserving the order. Is there an elegant way to do it with LINQ using a statement like: foreach (var item in list.Skip(1).TakeTheRest()) {.... I played around with TakeWhile…
Marcel
  • 15,039
  • 20
  • 92
  • 150
49
votes
10 answers

Python: How to ignore #comment lines when reading in a file

In Python, I have just read a line form a text file and I'd like to know how to code to ignore comments with a hash # at the beginning of the line. I think it should be something like this: for if line !contain # then ...process line …
John
  • 5,139
  • 19
  • 57
  • 62
46
votes
7 answers

LINQ Partition List into Lists of 8 members

How would one take a List (using LINQ) and break it into a List of Lists partitioning the original list on every 8th entry? I imagine something like this would involve Skip and/or Take, but I'm still pretty new to LINQ. Edit: Using C# / .Net…
Pretzel
  • 8,141
  • 16
  • 59
  • 84
41
votes
5 answers

Maven: skip test-compile in the life cycle?

I have project that I set to build with the test-jar and normal jar by using this setting: org.apache.maven.plugins maven-jar-plugin
fei
  • 2,224
  • 9
  • 31
  • 36
40
votes
8 answers

Skipping execution of -with- block

I am defining a context manager class and I would like to be able to skip the block of code without raising an exception if certain conditions are met during instantiation. For example, class My_Context(object): def __init__(self,mode=0): …
Macad_hack
  • 491
  • 7
  • 11
32
votes
5 answers

How can I read the header but also skip lines - read.table()?

Data.txt: Index;Time; 1;2345; 2;1423; 3;5123; The code: dat <- read.table('data.txt', skip = 1, nrows = 2, header =TRUE, sep =';') The result: X1 X2345 1 2 1423 2 3 5123 I expect the header to be Index and Time, as follows: Index Time 1 …
hans-t
  • 3,093
  • 8
  • 33
  • 39
31
votes
3 answers

read.csv, header on first line, skip second line

I have a CSV file with two header rows, the first row I want to be the header, but the second row I want to discard. If I do the following command: data <- read.csv("HK Stocks bbg.csv", header = T, stringsAsFactors = FALSE) The first row becomes…
mchangun
  • 9,814
  • 18
  • 71
  • 101
30
votes
2 answers

Rsync checksum only for same size files

There's a bunch of threads regarding rsync checksum, but none seems addressing this need, which would be the most effective and fastest way to sync, at least in my case: same time and same size ► skip file (no transfer, no checksum) different sizes…
Sylvain
  • 631
  • 1
  • 6
  • 6
28
votes
3 answers

IEnumerable Skip on unlimited sequence

I have a simple implementation of Fibonacci sequence using BigInteger: internal class FibonacciEnumerator : IEnumerator { private BigInteger _previous = 1; private BigInteger _current = 0; public void…
rbm
  • 3,243
  • 2
  • 17
  • 28
27
votes
4 answers

How to skip jacoco coverage check during build?

In our project we use jacoco-maven-plugin and during the build I get this error: [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.5:check (jacoco-check) on project my-project: Coverage checks have not been met. See log for details.…
IKo
  • 4,998
  • 8
  • 34
  • 54
1
2 3
48 49