?
Solved

cpytoimpf  csv file has a blank (space) for empty fields - I need to remove

Posted on 2008-11-03
3
Medium Priority
?
2,452 Views
Last Modified: 2013-12-06
I have an AS400 file.  This file has an external descripton on it.  I created a cpytoimpf to send it to a ahared drive that the PC user can acess to get the CSV file.  My only problem is that it is putting a blank space between the commas (, ,)when it should be just comma comma.  I have changed the cpytoimpf to take out all of the leading and trailing spaces, but still get at least one blank for an empty field.  The receiving program takes that as a character....  Other wise known as an error!  What can I do?
0
Comment
Question by:JanSrIt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Expert Comment

by:rward
ID: 22869594
We use the free CRTCSVF command from http://homepage1.nifty.com/uzaemon/

It works much faster than CPYTOIMPF and does not leave spaces for blank fields.
0
 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 1000 total points
ID: 22881891
0
 
LVL 27

Expert Comment

by:tliotta
ID: 22892244
JanSrIt:

> My only problem is that it is putting a blank space between the commas (, ,)when it should be just comma comma.

Are you wanting [comma comma] for character fields or numeric fields? If it's for character fields, does that mean that you are not using any delimiters such as quote marks? Do you want quotes around character fields when a non-blank value is there?

If you have Qshell installed, you can possibly use the db2 utility to format the lines any way you wish.

Or you might simply use sed from Qshell to edit the lines in your .CSV file, replacing [, ,] with [,,].

That is, generate the .CSV file with CPYTOIMPF as you're doing now; but run sed against it as soon as it's ready.

Tom
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question