@echo off
setlocal enableDelayedExpansion

set "word=VON MISES"
set "keep=3"
set "file=model.f06"

find  "   X   " model.f06  > extract_weight.txt

del extract_stress.txt

set n=%keep%
for /f "usebackq delims=" %%A in ("%file%") do (
  set "ln=%%A"
  if "!ln:%word%=!" neq "!ln!" (
    echo(
    set n=0
  )
  if !n! lss !keep! (
    echo !ln! >> extract_stress.txt
    set /a n=n+1
  )
)

REM pause > nul

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading