PC Review


Reply
Thread Tools Rate Thread

Create a flat file in Excel

 
 
GF08
Guest
Posts: n/a
 
      19th Nov 2009
I need to create a flat file in Excel using the pipe delimiter | as element,
and carriage return line feed as line delimiter.

How do I do this?
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      19th Nov 2009
You could change the windows list separator (in the regional settings applet in
the control panel) to the vertical bar (just temporarily).

Then save the file as a delimited file.

Or maybe you could create a formula in another cell:
=a1&"|"&b1&"|"&c1&....

And drag down.

Then copy that column and paste into notepad and save the file from notepad.


GF08 wrote:
>
> I need to create a flat file in Excel using the pipe delimiter | as element,
> and carriage return line feed as line delimiter.
>
> How do I do this?


--

Dave Peterson
 
Reply With Quote
 
Bob I
Guest
Posts: n/a
 
      19th Nov 2009
How about SaveAs CSV and then open the file in NotePad and do a Find
Replace , for | ?

GF08 wrote:

> I need to create a flat file in Excel using the pipe delimiter | as element,
> and carriage return line feed as line delimiter.
>
> How do I do this?


 
Reply With Quote
 
GF08
Guest
Posts: n/a
 
      19th Nov 2009
I'm not sure which of those options I should use. This file is going to be
used for an inventory file, and I imagine it is used to import the data.
Perhaps Excel isn't the proper format for it?

Right now we're creating a test file to see if this can be submitted through
a system - thus where I'm at at the moment. Of course, one of the
stipulations for this flat file is that is is supposed to be created by an
automated process, and not handmade. Not sure how I can do that without hand
making it first!

"GF08" wrote:

> I need to create a flat file in Excel using the pipe delimiter | as element,
> and carriage return line feed as line delimiter.
>
> How do I do this?

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      19th Nov 2009
You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()>


Sub SaveAsDelimitedFile()
Dim intFile As Integer, strData As String, rngRow As Range
Dim strFile As String

intFile = FreeFile
strFile = "c:\test.txt"

Open strFile For Output As #intFile
For Each rngRow In ActiveSheet.UsedRange.Rows
strData = Join(WorksheetFunction.Transpose( _
WorksheetFunction.Transpose(rngRow)), "|")
Print #intFile, strData
Next
Close #intFile

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"GF08" wrote:

> I need to create a flat file in Excel using the pipe delimiter | as element,
> and carriage return line feed as line delimiter.
>
> How do I do this?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Two Columns of Flat File to Final Excel File Neon520 Microsoft Excel Programming 1 9th Feb 2009 07:55 PM
Query to create a flat file in Access 2003 susanmgarrett Microsoft Access Getting Started 12 6th Dec 2004 08:56 PM
create a flat file Maggie Microsoft Access Queries 0 29th Jun 2004 09:01 PM
how to create a mdb file from the flat file through an automated process? archu Microsoft Access External Data 2 23rd Jun 2004 03:10 AM
Can I automatically create a daily chart from flat file? dcibrando Microsoft Excel Misc 3 30th Sep 2003 10:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:16 PM.