Begin the reading of a file from a specific line

前端 未结 3 1234
小蘑菇
小蘑菇 2021-01-27 18:01

i have a file similaire to this : ...

The hotspot server JVM has specific code-path optimizations
# which yield an approximate 10% gain over the client versi         


        
3条回答
  •  离开以前
    2021-01-27 18:31

    this is pseudo code that follows the kind of logic you would want to be able to accomplish this task.

    flag = false
    inside a loop
    {
     read in a line
     if( line != #############HDK1001############# && flag == false){  //check to see if you found your starting place
        nothing useful here. lets go around the loop and try again
    
      else // if i found it, set a flag to true
         flag = true;
    
      if( flag == true) // am i after my starting place but before my end place?
      {
        if( line == #############HDK1001#############) 
           do nothing and go back through the loop, this line is not useful to us
    
        else if( line ==  #############HDK7564#############) //did i find my end place?
          flag = false // yes i did, so lets not be able to assign stuff any more
    
        else // im not at the start, im not at the end. I must be inbetwee. lets read the data and assign it. 
          read in the lines and assign it to variables that you want
     }
    

提交回复
热议问题