r/programminghelp • u/No_Championship1324 • Dec 09 '23
Java Get Dates from CSV
Have a bunch of invoices from work. They’re all saved as CSV. Creating a Java program that reads through the csv and saves it in excel workbook. The goal is a different workbook for each year. Looking for help/insight on a method/code that would help me find year from the csv data, and from that save it in the proper workbook.
I know the date format is mm/dd/yyyy
I tried using if sc.next.length = 10 (10 is the length of the date) but had no luck there.
1
Upvotes
View all comments
Show parent comment
1
u/No_Championship1324 Dec 11 '23
Im self teaching by making codes that deal with what I do for work. Currently I’m a kitchen manager, I place weekly orders for work. I want to make a program that’ll take each invoice (CSV) and write it to excel (eventually a database but I don’t know sql so not gonna mess with that yet). Ideally each invoice is a separate sheet in the workbook. And it’d create new workbooks based on the year. I could hard code it to look for line 68 in each invoice and it grabs the date that way but I want/am looking for a more universal way to grab the dates.