Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. kkhhhkk

    Fortran, Using a loop and combined string to read a file

    Hello, I'm trying to use f90 to read multiple files using do loop, here is what I have: program rotate implicit none integer :: i character(len=20) :: MyStr, str1, str2, str_combined character(len=50) :: filename integer, parameter :: n = 10, m = 3 real :: matrix(n,m)...
  2. kkhhhkk

    Python Change values in one list by referring to a second one

    I have two lists, we'll call them x and n, I've been trying to write a script that goes through the elements of list n and if they are negative then to change the corresponding index element of x to a positive value I've tried for i in range(0,len(n),1): if n[i]<0: x[i] = abs(x[i])...
  3. kkhhhkk

    Python Write an empty line at the end of my files

    I have the following code that writes out multiple files. I want this code to also write out an empty line at the end of each file produced, I've tried adding ('\n\') inside the loop however it adds an empty line to every line which is annoying i = 0 f = open('innput.txt','r') always_print =...
  4. kkhhhkk

    Python Write in lines from a txt that is called by the occurrence of two strings

    I have a data file with has lines that look like this: input lines lines optimized input lines lines input lines lines optimized I want my script to go through this file, find the lines with input, find the line with optmized and write all the lines between them but only if its input lines...
Back
Top Bottom