CSV Formatting Introduced a Bug

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
Post Reply
CathyC
Posts: 469
Joined: November 16th, 2021, 11:15 am
Contact:

CSV Formatting Introduced a Bug

Unread post by CathyC »

I ran into an issue which I think could be helpful for someone in the future

We are importing addresses with a batch job from a CSV. Usually this comes straight from JDE or some other integration, but for now it is coming from a file that is shared. The file was given a few different ways.

First it was downloaded from teams, opened with excel to change the regional formatting for CSV, then opened with notepad to change the encoding format from ANSI to UTF-8 (needed to show special characters). When working with this version, we built out the batch job and it noted that one field had a blank value.

The 2nd file that was given was in the form of a link to an online excel. From there it was downloaded. Then we tried to recreate the steps by opening in excel desktop version to change the regional formatting, then opening in notepad to change the encoding from ANSI to UTF-8. The last step wasn't really needed because this time the encoding already was UTF-8. However this time, when we ran the already built batch job, it noted that the field contained a 0. This broke the batch job because our logic looked only for the blank, not the 0.

When this was found, we fixed it to look for blank or 0, but we weren't sure how it happened or how it ever worked.
  • It was hard to trace too, because the file changed hands so many times. The developer who uploaded it to the IDE to be used by the batch job doesn't have excel. The project manager who downloaded it does. So when the developer was troubleshooting, the option was to view the original and 2nd file in google sheets which is introducing a new program that wasn't in the original process.
  • Since the batch job always needs to run with the same filename, everyone's computer had files named the same and it was hard to tell if it was a 2nd or 3rd attempt of the 1st file or of the 2nd. Especially once we started opening both to compare and try and find a difference so they all had been touched and the date modified read that it was today.
We looked into the batch job and found a hard coded service where we put some sample data from the first file. in that service we confirmed it did used to be blank.

Conclusion: files changing hands multiple times and opened in different programs should be expected to be changed slightly which may cause issues. We definitely saw that the encoding format changed and that caused the special characters to be lost at one point.

Still not sure what caused the blank to be a 0 later on
Hardcoded Prevalues from first file test.png
Last edited by CathyC on April 26th, 2023, 11:14 am, edited 1 time in total. word count: 474

Tags:
CathyC
Posts: 469
Joined: November 16th, 2021, 11:15 am
Contact:

Re: CSV Formatting Introduced a Bug

Unread post by CathyC »

Additional conclusion: if you're unsure about the field type, cover all your "blank" bases.
word count: 15
Post Reply