Subtracting numbers in two different txt files

AI Thread Summary
To subtract numbers from two .txt files and save the results in a new file, several methods are suggested. Users can utilize OpenOffice or LibreOffice as alternatives to Excel. A Python script is recommended for those familiar with programming, allowing for efficient file manipulation. For Windows users, VBScript can be employed to read the files into arrays, perform the subtraction, and write the results back to a new .txt file. Additionally, Google Docs offers a spreadsheet application that can be used online for similar tasks. Providing specific details about the operating system and available tools can help in receiving tailored solutions.
Arjani
Messages
20
Reaction score
1
I have two .txt files with a bunch of numbers in them, below each other, like this:

File 1:

3
4
5

File 2:

1
2
1


Now I want to subtract the numbers in file 2 from the numbers in file 1 and get the results in a new .txt file:

File 3:

2
2
4

Very simple. I was going to do it in Excel, but I don't have that right now. Does anyone know another easy way?
 
Computer science news on Phys.org
Use OpenOffice then. Or write Python script. Or post your problem giving enough information about OS and tools available to get a meaningful answer.
 
If you've got Windows, try VBScript. Read the 2 files into an array, add the elements of the arrays and write the results back out. Here's a link showing how to read and write files: http://easyprograming.com/index.php/vb-script/13-open-an-existing-text-file-in-vb-script
 
Last edited by a moderator:
You could download Open or Libre Office, or sign up for a GMail account and use the spreadsheet Google Docs application.
 
I came across a video regarding the use of AI/ML to work through complex datasets to determine complicated protein structures. It is a promising and beneficial use of AI/ML. AlphaFold - The Most Useful Thing AI Has Ever Done https://www.ebi.ac.uk/training/online/courses/alphafold/an-introductory-guide-to-its-strengths-and-limitations/what-is-alphafold/ https://en.wikipedia.org/wiki/AlphaFold https://deepmind.google/about/ Edit/update: The AlphaFold article in Nature John Jumper...
Thread 'Urgent: Physically repair - or bypass - power button on Asus laptop'
Asus Vivobook S14 flip. The power button is wrecked. Unable to turn it on AT ALL. We can get into how and why it got wrecked later, but suffice to say a kitchen knife was involved: These buttons do want to NOT come off, not like other lappies, where they can snap in and out. And they sure don't go back on. So, in the absence of a longer-term solution that might involve a replacement, is there any way I can activate the power button, like with a paperclip or wire or something? It looks...
Back
Top