This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 10, 2012, 4:25 PM
1 Posts

import CSV blank cell question

  • Category: Other
  • Platform: Not Applicable
  • Release: 8.5.3
  • Role: Developer
  • Tags: CSV
  • Replies: 1
I have a (hopefully) quick question with an easy answer! I made a lotus notes DB to read in a massive CSV file. As my code reads each line, some of the fields are blank. My output skips the blank cells and moves to the next cell for a value, which messes up the output format.
 
For example, three categories may be First name, Last name, age, and the csv file may be "john, carpenter, 45, mark, , 58, Anne, Rice, 62" 
and the table output would have mark's last name be 58, his age is Anne, etc.
 
Is there some code I can pop in to set a value to the blank cells or have them show as a blank, instead of using the next available value in the file?
 
and lets say I cannot simply go into the csv file and replace the blank lines with something like "."
Jul 13, 2012, 7:39 AM
6 Posts
Re: import CSV blank cell question

For cnt = 1 To Len(lineOfCSV$)
If ( Mid( lineOfCSV$ , cnt, 1) = ";" ) Then
newLine =  newLine  + "; "
Else
newLine  =  newLine  + Mid( lineOfCSV$ , cnt, 1)
End If
Next
 
 
After that work with the newLine and don't forget to Trim empty spaces that you've just created. 
 
Regards  
 
Stephan 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal