I need a code/ script for this problem. I am new to programming and do not really know how to approach it, it may be a loop.
There is a file containing info about grocery stores A, B, C, and D. The code would split/separate the info of grocery store A alone on 1 file (AS) and all other grocery stores in another file (O).
I would like the python and Javascript version of this code please Thank you.
NOTE: I am writing in python programming language
code:
file = open("filename.txt","r") #opening main file
rows = file.readlines();
rows_list = []
for i in rows:
rows_list.append( i.split())
file1_text = ""
file2_text = ""
for i in rows_list:
file1_text = file1_text+ i[0] + "\n"
del i[0]
for i in rows_list:
text2 = " "
text2 = text2.join(i)
file2_text = file2_text + text2 + "\n"
file.close()
#opening file1 ->here it creates
file1 = open("AS.txt","w")
file1.write(file1_text)
file1.close()
#opening file2 ->here it creates
file2= open("O.txt","w")
file2.write(file2_text)
file2.close()
code screenshot:

Files Output:

I need a code/ script for this problem. I am new to programming and do not...
Please write this code in python programming and provide a screen short of the code. Reading: P4E 7; Tut 7.2, 7.2.1 Upload an original Python script that satisfies the following criteria: It has at least two functions Function 1: This function has one parameter, a string containing the path to an existing text file that will be read by your function Using a with statement, the function opens the file indicated by the parameter for reading The function counts the...
I need help modifying this python code: a) I need to take 2 attributes of the data as int - (columns (3 & 5) of my data) b) I need to take 2 more attributes as floats -(columns 4&6 of my data) c) I need to take 1 attribute as string (column 16 of my data) How would I modify this code # # Initial version - "standard programming" # # Define a list for the data. The data structure...
I need help with this python programming exercise, please!
thanks in advance
Create a Python script file called hw4.py. Add your name at the top as a comment, along with the class name and date. Both exercises should be in this file, with a comment before each of them to mark it. Ex. 1. Write a program that inputs an integer number from the user, then prints a letter "O" in ASCII art using a width of 5 and the...
I am in java programming I need to // TO DO: Add a function call to the function named // findMaxSalesAndBestSellingAgent() // with 3 arguments (maxSalesDouble, totalHousePriceDouble, and // totalHousePriceDouble) // using an assignment statement form) and store the value returned by the // function // in the input variable maxSalesDouble I wrote this in the code maxSalesDouble = findMaxSalesAndBestSellingAgent(totalHousePriceDouble); Would this be correct?
I really need help on this programming problem that am doing in Visual Studio 2019 in C++ Submit your .cpp file as well as the input file, the output file, and the screen shot of all the files tiled next to each other here! Instructions: Write a menu driven program that has three options: Option 1: Write a function that calculates the tax for an iphone. The price and the tax rate should be asked from the user. Input validation:...
I am new to programming (2 weeks of playing with it) I have written code for a timer in Visual Studio 2013. I am wondering if someone can show me how to write code/what the code would look like in a MODULE1.vb. I was thinking that for this timer I could create MsgBox using a DO UNTIL LOOP that would pop up every 20 seconds that says "hurry up!" until 1 minute has passed. As I said I am just...
Hello, I am attempting to write a basic shell script using bash. It will need to print the user, host, time, and date. It will need to take user input for a txt file to be searched and create a new file to save the results. It must print the number of lines and characters in the text. The user will need to enter three words to be searched, and the number of occurrences of those words in the text...
i need help with this homework web page and i need the code too Using the "do while" or the "for" control statements, have a visitor to your Web page do, or see, something repeatedly. You could have him or her enter a number of months, an interest-rate, and an amount, and print out a table with the amount on deposit. Try to make the loop appropriate to the website theme that you have picked. Use a function in your...
Write a simple grep like simple utility in the C programming language. Approach the problem by following these steps: a) Your task is to write a simple grep like utility in the C programming language. You can name it “mygrep”. grep is basically used for searching. For example, “mygrep foo myfile” command returns all the lines that contain a string matching the expression "foo" in the file. Your code will be checked by running such a simple command. It is...
I am writing a program in c programming and it is supposed to do the following using mc9s12dg256.h microcontroller When both DIP switches #8 and #1 are high, turn on all LEDS. When both DIP switches #8 and #1 are low, turn off all LEDs When DIP switch #8 is high and #1 is low, turn on all the even numbered LEDs. When DIP switch #1 is high and #8 is low, turn on all the odd numbered LEDs. Your...