I have built an array, such as A = [a1,a2,…aN]. How to save this array into a data file, with each element to be placed at one row. In other words, for the array A, the file should look like
a1
a2
a3
...
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Very simple (this is assuming, of course, that your array is explicitly specified as an array data structure, which your question doesn’t quite make clear):
The above script will write the following to “output.txt”: