24
Answers

Save text file with a new name without changing the contents

Rano AH

Rano AH

11y
1.9k
1

I have a text file with a specific order of lines and content. I need to write a code that gets the values in rows numbers 3, 4 and 5 then it pushes those values to the file name and save the file by giving the new name and keep a the original file without any changes.


Example:

File name: Default.txt

  1. ABC

  2. DEF

  3. ValueNo1
  4. ValueNo2

  5. ValueNo3

  6. fdf

  7. FDFDFD
  8. The new file name will be Default-ValueNo1ValueNo1-ValueNo2ValueNo2-ValueNo3ValueNo3

 

Answers (24)