If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > formatting

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-21-11, 22:42
OCM OCM is offline
Registered User
 
Join Date: Sep 2002
Location: USA
Posts: 63
formatting

Greeting,

I’m trying to submit a required state report as a text in certain format. I used Unidata to pull the required field as flat file and import the data to Excel 2007 successfully. The file has about 25 column (FName, MI, LName, SSN, DOB etc.)

The state wants, let’s say 5 spaces between FName and MI, and 4 spaces between MI and LName and 4 spaces between LName and SSN ,3 spaces between SSN and DOB etc.

What is the best way to accomplish the formatting?

Thank you in advance.

OCm
Reply With Quote
  #2 (permalink)  
Old 02-22-11, 10:50
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,613
In Excel there isn't a "best way" to do this kind of manipulation. Excel isn't really built to do this kind of work, so your approach is like using a toothbrush to adjust your television... It might be possible, but it probably won't be a "best way" in anybody's opinion.

You may be able to do what you've described by creating formulas to construct a column that contains the text formatted to meet the state requirements. Once you get the column correctly built, you'll need to copy the contents of that column into a text editor like Notepad, then save the results. This will do the task you need done, but it won't be pretty!

Depending on how much work you want to do and how much learning you are willing to do there are other options. If you really need to reformat one flat text file into another text file format, then I'd strongly suggest investigating a free tool called GAWK which is a simple tool designed to make mangling text files simple. GAWK doesn't have a GUI, but it is the best fit for the problem you've described (least work to produce exactly what you want). Check out the printf() function and you ought to be on your way.

There are a number of reporting tools that can approximate what you've described. The report writer in MS-Access doesn't work well for me when laying out character based output like a file format, but I know some people that swear by it (while I swear at it).

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #3 (permalink)  
Old 02-22-11, 18:32
OCM OCM is offline
Registered User
 
Join Date: Sep 2002
Location: USA
Posts: 63
formatting

Pat,

Thank you for your quick reply. Per your suggestion, I’ve attempted to download the utility following the link you provided. The file is called ‘UnxUpdates.zip’ and while trying to run it, I see a lot of application with .exe and wasn’t sure:

1. Which file from the list to pick
2. using these tools, how to go about getting the task accomplished

Is there any supporting user manual for it?

Please let me know.

Thanks,

OCM
Reply With Quote
  #4 (permalink)  
Old 02-23-11, 15:03
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,613
This suggestion is swinging a bigger hammer to make the "bootstrap process" of getting GAWK, it's documentaiton, and the supporting files loaded onto a machine. This solution is overkill, but it is comparatively easy to do compared to figuring things out from scratch.

If you want the background (explanation) to help understand what these tools are, where they came from, and how very many people have contributed to them you can find more details at GetGnuWin32 – Maintaining a Gnuwin32 Package archive (and this is a good bit of background if you have time to digest it). If you just want to "get the show on the road", go to Automated gnuwin32 download tool - Browse Files at SourceForge.net and commence!

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #5 (permalink)  
Old 02-26-11, 20:27
OCM OCM is offline
Registered User
 
Join Date: Sep 2002
Location: USA
Posts: 63
formatting

Thanks PatP, for your reply & the link you provided was very helpful.

Regards,

OCM
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On