looking for flat file utility that displays character positions

I am creating a flat file by pulling data into a table via a query, then using the bcp command to pull it into a flat file.  My query adds the required spaces to each field.  But it was all done manually and prone to error.  I'm looking for a utility that loads the flat file and displays the data with starting/ending character positions.  Does that make sense?

If I was told that the last_name field should start on position 71 and should end on position 100, I need to verify that I've really done that.  

Is there a utility that can load my flat file and visually display the character positions of the data?  I would assume maybe a really good text editor would do this but I'm not aware of any and apparently not searching on the right terms in Google.

Thank you
lottidahAsked:
Who is Participating?
 
HainKurtSr. System AnalystCommented:
instead of using this

select 'HainKurt'

use this

select Left('HainKurt' + replicate(' ',20), 20)

in your query... so it will make sure it is 20 char in length padded with " " to the right...

or use

select CAST('HainKurt' as CHAR(20))

and then export it to flat file, then everything will be in place...

0
 
lottidahAuthor Commented:
Thank you, that is much easier!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.