Appending a for loop onto a new row when creating a csv
I know more python and R than JavaScript and I am currently trying to write a program that uses the node.js module "themeparks" in order to create a database of wait times for analytical purposes. I'm going off the examples for the app that rely on for-loops for writing the "wait times" for rides and the ride name itself. I plan on running one for loop for the ride name in the exact same manner as the ride.waiTime for the csv header, but setup a scheduler to not run as often.
Long story short, I am currently trying to make this for loop begin on a new row in the csv file, but instead I either get continuous columns added every time the for loop is run, or when I try to att "rn" within the for loop, it wants put each wait time on a new row (which I understand.
I simple want to start this forloop on a new row (the next one) everytime it runs, except maybe the first time if that's possible?
// include the Themeparks library
var Themeparks = require("themeparks");
var fs = require('fs');
//Date
var datetime = require('node-datetime');
var dt = datetime.create();
var TodayDate = dt.format('m-d-Y');
var newLine= "rn";
// access a specific park
var disneyMagicKingdom = new Themeparks.Parks.WaltDisneyWorldMagicKingdom
// access wait times by Promise
disneyMagicKingdom.GetWaitTimes().then(function(rides){
for(var i=0 , ride; ride=rides[i++];)
{
//console.log((ride.name + ": " + ride.waitTime + " minutes wait"))
fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " );
}
}, console.error);
javascript node.js
add a comment |
I know more python and R than JavaScript and I am currently trying to write a program that uses the node.js module "themeparks" in order to create a database of wait times for analytical purposes. I'm going off the examples for the app that rely on for-loops for writing the "wait times" for rides and the ride name itself. I plan on running one for loop for the ride name in the exact same manner as the ride.waiTime for the csv header, but setup a scheduler to not run as often.
Long story short, I am currently trying to make this for loop begin on a new row in the csv file, but instead I either get continuous columns added every time the for loop is run, or when I try to att "rn" within the for loop, it wants put each wait time on a new row (which I understand.
I simple want to start this forloop on a new row (the next one) everytime it runs, except maybe the first time if that's possible?
// include the Themeparks library
var Themeparks = require("themeparks");
var fs = require('fs');
//Date
var datetime = require('node-datetime');
var dt = datetime.create();
var TodayDate = dt.format('m-d-Y');
var newLine= "rn";
// access a specific park
var disneyMagicKingdom = new Themeparks.Parks.WaltDisneyWorldMagicKingdom
// access wait times by Promise
disneyMagicKingdom.GetWaitTimes().then(function(rides){
for(var i=0 , ride; ride=rides[i++];)
{
//console.log((ride.name + ": " + ride.waitTime + " minutes wait"))
fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " );
}
}, console.error);
javascript node.js
Can you post some example output of the code you have up there?
– skylerl
Dec 27 '18 at 21:31
add a comment |
I know more python and R than JavaScript and I am currently trying to write a program that uses the node.js module "themeparks" in order to create a database of wait times for analytical purposes. I'm going off the examples for the app that rely on for-loops for writing the "wait times" for rides and the ride name itself. I plan on running one for loop for the ride name in the exact same manner as the ride.waiTime for the csv header, but setup a scheduler to not run as often.
Long story short, I am currently trying to make this for loop begin on a new row in the csv file, but instead I either get continuous columns added every time the for loop is run, or when I try to att "rn" within the for loop, it wants put each wait time on a new row (which I understand.
I simple want to start this forloop on a new row (the next one) everytime it runs, except maybe the first time if that's possible?
// include the Themeparks library
var Themeparks = require("themeparks");
var fs = require('fs');
//Date
var datetime = require('node-datetime');
var dt = datetime.create();
var TodayDate = dt.format('m-d-Y');
var newLine= "rn";
// access a specific park
var disneyMagicKingdom = new Themeparks.Parks.WaltDisneyWorldMagicKingdom
// access wait times by Promise
disneyMagicKingdom.GetWaitTimes().then(function(rides){
for(var i=0 , ride; ride=rides[i++];)
{
//console.log((ride.name + ": " + ride.waitTime + " minutes wait"))
fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " );
}
}, console.error);
javascript node.js
I know more python and R than JavaScript and I am currently trying to write a program that uses the node.js module "themeparks" in order to create a database of wait times for analytical purposes. I'm going off the examples for the app that rely on for-loops for writing the "wait times" for rides and the ride name itself. I plan on running one for loop for the ride name in the exact same manner as the ride.waiTime for the csv header, but setup a scheduler to not run as often.
Long story short, I am currently trying to make this for loop begin on a new row in the csv file, but instead I either get continuous columns added every time the for loop is run, or when I try to att "rn" within the for loop, it wants put each wait time on a new row (which I understand.
I simple want to start this forloop on a new row (the next one) everytime it runs, except maybe the first time if that's possible?
// include the Themeparks library
var Themeparks = require("themeparks");
var fs = require('fs');
//Date
var datetime = require('node-datetime');
var dt = datetime.create();
var TodayDate = dt.format('m-d-Y');
var newLine= "rn";
// access a specific park
var disneyMagicKingdom = new Themeparks.Parks.WaltDisneyWorldMagicKingdom
// access wait times by Promise
disneyMagicKingdom.GetWaitTimes().then(function(rides){
for(var i=0 , ride; ride=rides[i++];)
{
//console.log((ride.name + ": " + ride.waitTime + " minutes wait"))
fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " );
}
}, console.error);
javascript node.js
javascript node.js
edited Dec 28 '18 at 0:07
skylerl
1,456102950
1,456102950
asked Dec 27 '18 at 21:26
tawildberger
31
31
Can you post some example output of the code you have up there?
– skylerl
Dec 27 '18 at 21:31
add a comment |
Can you post some example output of the code you have up there?
– skylerl
Dec 27 '18 at 21:31
Can you post some example output of the code you have up there?
– skylerl
Dec 27 '18 at 21:31
Can you post some example output of the code you have up there?
– skylerl
Dec 27 '18 at 21:31
add a comment |
1 Answer
1
active
oldest
votes
Okay, so I made some assumptions based on what I'd expect this CSV to look like, so let me know if this is correct. Here is the example output I was able to get this, including a header:
Ride_Name,Wait_Time
"Stitch's Great Escape! - Temporarily Closed",0
"Monsters, Inc. Laugh Floor",25
"Walt Disney World Railroad - Frontierland",0
"Walt Disney's Enchanted Tiki Room",0
"Sorcerers of the Magic Kingdom",0
"The Barnstormer",65
"Walt Disney World Railroad - Fantasyland",0
"Casey Jr. Splash 'N' Soak Station",0
"Cinderella Castle",0
"Under the Sea - Journey of The Little Mermaid",70
...
"The Magic Carpets of Aladdin",0
"The Many Adventures of Winnie the Pooh",70
"Tom Sawyer Island",0
"Tomorrowland Speedway",55
"Tomorrowland Transit Authority PeopleMover",35
"Walt Disney World Railroad - Main Street, U.S.A.",0
"Walt Disney's Carousel of Progress",0
"Country Bear Jamboree",0
"The Hall of Presidents",0
A couple things to note, before I show the code. You typically want to make sure there's no extra spaces between the values and the commas, as that could be considered data to whatever is parsing your CSV file. I also added quotes to the names of the rides, since as you can see, Monsters, Inc. Laugh Floor has a comma, Monsters and Inc. Laugh Floor were being split into two columns. Now let's talk about the code:
First thing, to get the header, you can just print that header to your file, outside of the for loop you have. Then, I modified fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " ); to print the ride name (wrapped in quotes) and removed the extra space after the ,. After that line is printed, in order to go to the new line, I appended a "rn" to the line, so that the next row of data is properly inserted at below the next line. The code could definitely be simplified, but I kept the new line piece separate for examples sake.
// Print the header with the Ride_Name and Wait_Time, before looping through the data
// Printing it before will prevent it from being printed before each row of data
fs.appendFileSync(TodayDate + ' MK.csv', 'Ride_Name,Wait_Timern');
disneyMagicKingdom.GetWaitTimes().then(function(rides) {
for(var i=0 , ride; ride=rides[i++];)
{
// Write out the data in this format: "<RIDE NAME>",<WAIT TIME>
fs.appendFileSync( TodayDate + ' MK.csv', """ + ride.name + """ + "," + ride.waitTime);
// Write out a new line so that when this loop repeats, the next row will be written on its own line
fs.appendFileSync(TodayDate + ' MK.csv', 'rn');
}
}, console.error);
Thank you! I think you gave me more than I could ask for so quickly. I'm glad you understand what I was trying to do. And I didn't think so have the /r/n be with in the loop but not apart of it. I tried to have it before the loop or in other and kept getting errors. My plan is actually to have the ride names be the column headers, and each row be the updated times with a time stamp column at the end. So have the ride names run once a day at the beginning of the day, and schedule the ride times to run every 5 or 10 minutes afterward. Any easy way to format it like that? I can do the scheduler.
– tawildberger
Dec 27 '18 at 23:45
Happy to help, make sure on StackOverflow, if your question is answered that you click the checkmark! Is your goal to create a report of the wait times over time? If so, it may be easier to structure it the same way you have it now and add the timestamp at the end. That way, if a ride is ever removed or added, you don't need a crazy big schema evolution. It becomes a table of wait time events and if you need the wait time for a specific ride, you can filter to that ride name!
– skylerl
Dec 28 '18 at 1:57
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53951049%2fappending-a-for-loop-onto-a-new-row-when-creating-a-csv%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Okay, so I made some assumptions based on what I'd expect this CSV to look like, so let me know if this is correct. Here is the example output I was able to get this, including a header:
Ride_Name,Wait_Time
"Stitch's Great Escape! - Temporarily Closed",0
"Monsters, Inc. Laugh Floor",25
"Walt Disney World Railroad - Frontierland",0
"Walt Disney's Enchanted Tiki Room",0
"Sorcerers of the Magic Kingdom",0
"The Barnstormer",65
"Walt Disney World Railroad - Fantasyland",0
"Casey Jr. Splash 'N' Soak Station",0
"Cinderella Castle",0
"Under the Sea - Journey of The Little Mermaid",70
...
"The Magic Carpets of Aladdin",0
"The Many Adventures of Winnie the Pooh",70
"Tom Sawyer Island",0
"Tomorrowland Speedway",55
"Tomorrowland Transit Authority PeopleMover",35
"Walt Disney World Railroad - Main Street, U.S.A.",0
"Walt Disney's Carousel of Progress",0
"Country Bear Jamboree",0
"The Hall of Presidents",0
A couple things to note, before I show the code. You typically want to make sure there's no extra spaces between the values and the commas, as that could be considered data to whatever is parsing your CSV file. I also added quotes to the names of the rides, since as you can see, Monsters, Inc. Laugh Floor has a comma, Monsters and Inc. Laugh Floor were being split into two columns. Now let's talk about the code:
First thing, to get the header, you can just print that header to your file, outside of the for loop you have. Then, I modified fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " ); to print the ride name (wrapped in quotes) and removed the extra space after the ,. After that line is printed, in order to go to the new line, I appended a "rn" to the line, so that the next row of data is properly inserted at below the next line. The code could definitely be simplified, but I kept the new line piece separate for examples sake.
// Print the header with the Ride_Name and Wait_Time, before looping through the data
// Printing it before will prevent it from being printed before each row of data
fs.appendFileSync(TodayDate + ' MK.csv', 'Ride_Name,Wait_Timern');
disneyMagicKingdom.GetWaitTimes().then(function(rides) {
for(var i=0 , ride; ride=rides[i++];)
{
// Write out the data in this format: "<RIDE NAME>",<WAIT TIME>
fs.appendFileSync( TodayDate + ' MK.csv', """ + ride.name + """ + "," + ride.waitTime);
// Write out a new line so that when this loop repeats, the next row will be written on its own line
fs.appendFileSync(TodayDate + ' MK.csv', 'rn');
}
}, console.error);
Thank you! I think you gave me more than I could ask for so quickly. I'm glad you understand what I was trying to do. And I didn't think so have the /r/n be with in the loop but not apart of it. I tried to have it before the loop or in other and kept getting errors. My plan is actually to have the ride names be the column headers, and each row be the updated times with a time stamp column at the end. So have the ride names run once a day at the beginning of the day, and schedule the ride times to run every 5 or 10 minutes afterward. Any easy way to format it like that? I can do the scheduler.
– tawildberger
Dec 27 '18 at 23:45
Happy to help, make sure on StackOverflow, if your question is answered that you click the checkmark! Is your goal to create a report of the wait times over time? If so, it may be easier to structure it the same way you have it now and add the timestamp at the end. That way, if a ride is ever removed or added, you don't need a crazy big schema evolution. It becomes a table of wait time events and if you need the wait time for a specific ride, you can filter to that ride name!
– skylerl
Dec 28 '18 at 1:57
add a comment |
Okay, so I made some assumptions based on what I'd expect this CSV to look like, so let me know if this is correct. Here is the example output I was able to get this, including a header:
Ride_Name,Wait_Time
"Stitch's Great Escape! - Temporarily Closed",0
"Monsters, Inc. Laugh Floor",25
"Walt Disney World Railroad - Frontierland",0
"Walt Disney's Enchanted Tiki Room",0
"Sorcerers of the Magic Kingdom",0
"The Barnstormer",65
"Walt Disney World Railroad - Fantasyland",0
"Casey Jr. Splash 'N' Soak Station",0
"Cinderella Castle",0
"Under the Sea - Journey of The Little Mermaid",70
...
"The Magic Carpets of Aladdin",0
"The Many Adventures of Winnie the Pooh",70
"Tom Sawyer Island",0
"Tomorrowland Speedway",55
"Tomorrowland Transit Authority PeopleMover",35
"Walt Disney World Railroad - Main Street, U.S.A.",0
"Walt Disney's Carousel of Progress",0
"Country Bear Jamboree",0
"The Hall of Presidents",0
A couple things to note, before I show the code. You typically want to make sure there's no extra spaces between the values and the commas, as that could be considered data to whatever is parsing your CSV file. I also added quotes to the names of the rides, since as you can see, Monsters, Inc. Laugh Floor has a comma, Monsters and Inc. Laugh Floor were being split into two columns. Now let's talk about the code:
First thing, to get the header, you can just print that header to your file, outside of the for loop you have. Then, I modified fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " ); to print the ride name (wrapped in quotes) and removed the extra space after the ,. After that line is printed, in order to go to the new line, I appended a "rn" to the line, so that the next row of data is properly inserted at below the next line. The code could definitely be simplified, but I kept the new line piece separate for examples sake.
// Print the header with the Ride_Name and Wait_Time, before looping through the data
// Printing it before will prevent it from being printed before each row of data
fs.appendFileSync(TodayDate + ' MK.csv', 'Ride_Name,Wait_Timern');
disneyMagicKingdom.GetWaitTimes().then(function(rides) {
for(var i=0 , ride; ride=rides[i++];)
{
// Write out the data in this format: "<RIDE NAME>",<WAIT TIME>
fs.appendFileSync( TodayDate + ' MK.csv', """ + ride.name + """ + "," + ride.waitTime);
// Write out a new line so that when this loop repeats, the next row will be written on its own line
fs.appendFileSync(TodayDate + ' MK.csv', 'rn');
}
}, console.error);
Thank you! I think you gave me more than I could ask for so quickly. I'm glad you understand what I was trying to do. And I didn't think so have the /r/n be with in the loop but not apart of it. I tried to have it before the loop or in other and kept getting errors. My plan is actually to have the ride names be the column headers, and each row be the updated times with a time stamp column at the end. So have the ride names run once a day at the beginning of the day, and schedule the ride times to run every 5 or 10 minutes afterward. Any easy way to format it like that? I can do the scheduler.
– tawildberger
Dec 27 '18 at 23:45
Happy to help, make sure on StackOverflow, if your question is answered that you click the checkmark! Is your goal to create a report of the wait times over time? If so, it may be easier to structure it the same way you have it now and add the timestamp at the end. That way, if a ride is ever removed or added, you don't need a crazy big schema evolution. It becomes a table of wait time events and if you need the wait time for a specific ride, you can filter to that ride name!
– skylerl
Dec 28 '18 at 1:57
add a comment |
Okay, so I made some assumptions based on what I'd expect this CSV to look like, so let me know if this is correct. Here is the example output I was able to get this, including a header:
Ride_Name,Wait_Time
"Stitch's Great Escape! - Temporarily Closed",0
"Monsters, Inc. Laugh Floor",25
"Walt Disney World Railroad - Frontierland",0
"Walt Disney's Enchanted Tiki Room",0
"Sorcerers of the Magic Kingdom",0
"The Barnstormer",65
"Walt Disney World Railroad - Fantasyland",0
"Casey Jr. Splash 'N' Soak Station",0
"Cinderella Castle",0
"Under the Sea - Journey of The Little Mermaid",70
...
"The Magic Carpets of Aladdin",0
"The Many Adventures of Winnie the Pooh",70
"Tom Sawyer Island",0
"Tomorrowland Speedway",55
"Tomorrowland Transit Authority PeopleMover",35
"Walt Disney World Railroad - Main Street, U.S.A.",0
"Walt Disney's Carousel of Progress",0
"Country Bear Jamboree",0
"The Hall of Presidents",0
A couple things to note, before I show the code. You typically want to make sure there's no extra spaces between the values and the commas, as that could be considered data to whatever is parsing your CSV file. I also added quotes to the names of the rides, since as you can see, Monsters, Inc. Laugh Floor has a comma, Monsters and Inc. Laugh Floor were being split into two columns. Now let's talk about the code:
First thing, to get the header, you can just print that header to your file, outside of the for loop you have. Then, I modified fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " ); to print the ride name (wrapped in quotes) and removed the extra space after the ,. After that line is printed, in order to go to the new line, I appended a "rn" to the line, so that the next row of data is properly inserted at below the next line. The code could definitely be simplified, but I kept the new line piece separate for examples sake.
// Print the header with the Ride_Name and Wait_Time, before looping through the data
// Printing it before will prevent it from being printed before each row of data
fs.appendFileSync(TodayDate + ' MK.csv', 'Ride_Name,Wait_Timern');
disneyMagicKingdom.GetWaitTimes().then(function(rides) {
for(var i=0 , ride; ride=rides[i++];)
{
// Write out the data in this format: "<RIDE NAME>",<WAIT TIME>
fs.appendFileSync( TodayDate + ' MK.csv', """ + ride.name + """ + "," + ride.waitTime);
// Write out a new line so that when this loop repeats, the next row will be written on its own line
fs.appendFileSync(TodayDate + ' MK.csv', 'rn');
}
}, console.error);
Okay, so I made some assumptions based on what I'd expect this CSV to look like, so let me know if this is correct. Here is the example output I was able to get this, including a header:
Ride_Name,Wait_Time
"Stitch's Great Escape! - Temporarily Closed",0
"Monsters, Inc. Laugh Floor",25
"Walt Disney World Railroad - Frontierland",0
"Walt Disney's Enchanted Tiki Room",0
"Sorcerers of the Magic Kingdom",0
"The Barnstormer",65
"Walt Disney World Railroad - Fantasyland",0
"Casey Jr. Splash 'N' Soak Station",0
"Cinderella Castle",0
"Under the Sea - Journey of The Little Mermaid",70
...
"The Magic Carpets of Aladdin",0
"The Many Adventures of Winnie the Pooh",70
"Tom Sawyer Island",0
"Tomorrowland Speedway",55
"Tomorrowland Transit Authority PeopleMover",35
"Walt Disney World Railroad - Main Street, U.S.A.",0
"Walt Disney's Carousel of Progress",0
"Country Bear Jamboree",0
"The Hall of Presidents",0
A couple things to note, before I show the code. You typically want to make sure there's no extra spaces between the values and the commas, as that could be considered data to whatever is parsing your CSV file. I also added quotes to the names of the rides, since as you can see, Monsters, Inc. Laugh Floor has a comma, Monsters and Inc. Laugh Floor were being split into two columns. Now let's talk about the code:
First thing, to get the header, you can just print that header to your file, outside of the for loop you have. Then, I modified fs.appendFileSync( TodayDate + ' MK.csv', ride.waitTime + ", " ); to print the ride name (wrapped in quotes) and removed the extra space after the ,. After that line is printed, in order to go to the new line, I appended a "rn" to the line, so that the next row of data is properly inserted at below the next line. The code could definitely be simplified, but I kept the new line piece separate for examples sake.
// Print the header with the Ride_Name and Wait_Time, before looping through the data
// Printing it before will prevent it from being printed before each row of data
fs.appendFileSync(TodayDate + ' MK.csv', 'Ride_Name,Wait_Timern');
disneyMagicKingdom.GetWaitTimes().then(function(rides) {
for(var i=0 , ride; ride=rides[i++];)
{
// Write out the data in this format: "<RIDE NAME>",<WAIT TIME>
fs.appendFileSync( TodayDate + ' MK.csv', """ + ride.name + """ + "," + ride.waitTime);
// Write out a new line so that when this loop repeats, the next row will be written on its own line
fs.appendFileSync(TodayDate + ' MK.csv', 'rn');
}
}, console.error);
edited Dec 28 '18 at 17:13
answered Dec 27 '18 at 21:55
skylerl
1,456102950
1,456102950
Thank you! I think you gave me more than I could ask for so quickly. I'm glad you understand what I was trying to do. And I didn't think so have the /r/n be with in the loop but not apart of it. I tried to have it before the loop or in other and kept getting errors. My plan is actually to have the ride names be the column headers, and each row be the updated times with a time stamp column at the end. So have the ride names run once a day at the beginning of the day, and schedule the ride times to run every 5 or 10 minutes afterward. Any easy way to format it like that? I can do the scheduler.
– tawildberger
Dec 27 '18 at 23:45
Happy to help, make sure on StackOverflow, if your question is answered that you click the checkmark! Is your goal to create a report of the wait times over time? If so, it may be easier to structure it the same way you have it now and add the timestamp at the end. That way, if a ride is ever removed or added, you don't need a crazy big schema evolution. It becomes a table of wait time events and if you need the wait time for a specific ride, you can filter to that ride name!
– skylerl
Dec 28 '18 at 1:57
add a comment |
Thank you! I think you gave me more than I could ask for so quickly. I'm glad you understand what I was trying to do. And I didn't think so have the /r/n be with in the loop but not apart of it. I tried to have it before the loop or in other and kept getting errors. My plan is actually to have the ride names be the column headers, and each row be the updated times with a time stamp column at the end. So have the ride names run once a day at the beginning of the day, and schedule the ride times to run every 5 or 10 minutes afterward. Any easy way to format it like that? I can do the scheduler.
– tawildberger
Dec 27 '18 at 23:45
Happy to help, make sure on StackOverflow, if your question is answered that you click the checkmark! Is your goal to create a report of the wait times over time? If so, it may be easier to structure it the same way you have it now and add the timestamp at the end. That way, if a ride is ever removed or added, you don't need a crazy big schema evolution. It becomes a table of wait time events and if you need the wait time for a specific ride, you can filter to that ride name!
– skylerl
Dec 28 '18 at 1:57
Thank you! I think you gave me more than I could ask for so quickly. I'm glad you understand what I was trying to do. And I didn't think so have the /r/n be with in the loop but not apart of it. I tried to have it before the loop or in other and kept getting errors. My plan is actually to have the ride names be the column headers, and each row be the updated times with a time stamp column at the end. So have the ride names run once a day at the beginning of the day, and schedule the ride times to run every 5 or 10 minutes afterward. Any easy way to format it like that? I can do the scheduler.
– tawildberger
Dec 27 '18 at 23:45
Thank you! I think you gave me more than I could ask for so quickly. I'm glad you understand what I was trying to do. And I didn't think so have the /r/n be with in the loop but not apart of it. I tried to have it before the loop or in other and kept getting errors. My plan is actually to have the ride names be the column headers, and each row be the updated times with a time stamp column at the end. So have the ride names run once a day at the beginning of the day, and schedule the ride times to run every 5 or 10 minutes afterward. Any easy way to format it like that? I can do the scheduler.
– tawildberger
Dec 27 '18 at 23:45
Happy to help, make sure on StackOverflow, if your question is answered that you click the checkmark! Is your goal to create a report of the wait times over time? If so, it may be easier to structure it the same way you have it now and add the timestamp at the end. That way, if a ride is ever removed or added, you don't need a crazy big schema evolution. It becomes a table of wait time events and if you need the wait time for a specific ride, you can filter to that ride name!
– skylerl
Dec 28 '18 at 1:57
Happy to help, make sure on StackOverflow, if your question is answered that you click the checkmark! Is your goal to create a report of the wait times over time? If so, it may be easier to structure it the same way you have it now and add the timestamp at the end. That way, if a ride is ever removed or added, you don't need a crazy big schema evolution. It becomes a table of wait time events and if you need the wait time for a specific ride, you can filter to that ride name!
– skylerl
Dec 28 '18 at 1:57
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53951049%2fappending-a-for-loop-onto-a-new-row-when-creating-a-csv%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you post some example output of the code you have up there?
– skylerl
Dec 27 '18 at 21:31