I have a problem. I have a csv that stores data about checks in a private restaurant . Not CC's or anything, just table number, items, server number, blah. It repeats for every check a four lines that start with 1,4,5,6,7. I have a interface that picks up this csv and reads line four to help billing guests. It was written in VB, it will not be re-written by the programmers. I need the data from line 7 to be in the line four position. I was looking over the csv reader and writer objects, but I can't wrap my head around this. Any ideas? Thank you so much in advance.
TheNational22
9
Light Poster
Recommended Answers
Jump to PostHuh? Not exactly sure what you mean, but if the csv writer confuses you, just write to it like this:
csvfile = open('myrestaurant.csv','w') csvfile.write('Server,Table,Items,Bill\n') csvfile.write('Gary,10,4,$40') csvfile.close()
As far as I know, csv files are just text files of comma delimited strings. one line = one row.
Jump to PostYes zachabest is correct. There is nothing special about a csv file. It is literally a text file that uses commas to delimit, or separate, each data cell of a row. Each new line is therefore a new row.
I've found that using the csv modules are overkill and …
All 5 Replies
zachabesh
5
Junior Poster
jlm699
320
Veteran Poster
TheNational22
9
Light Poster
woooee
814
Nearly a Posting Maven
zachabesh
5
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.