Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding a new file extension for Pipe Delimited files

Hi All,

Does anybody know a method so that pipe-delimited-separator text files
can be recognised and handle like CSV files in much the same way ( but
without disturbing CSV handling) ?

My problem is that I have a high volume of standard CSV files and pipe
delimited files. At the moment I have to you the file - import -
delimited | method..

Can this be achieved by adding a new file extension, say *.PCSV which
open and handle like CSV files?

Cheers in advance.
Phil

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Adding a new file extension for Pipe Delimited files

Phil,
Try this. You can change the last argument of GetOpenFilename to true (and
handle the array) to deal with multiple files names.

Private Sub CommandButton1_Click()
Dim FileName As Variant

FileName = Application.GetOpenFilename("Pipe Separated File (*.psv), *.psv",
, , , False)

If FileName < False Then
Workbooks.OpenText FileName, xlDelimited, TextQualifier:=xlDoubleQuote,
Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar:="|"
End If

End Sub

NickHK

wrote in message
oups.com...
Hi All,

Does anybody know a method so that pipe-delimited-separator text files
can be recognised and handle like CSV files in much the same way ( but
without disturbing CSV handling) ?

My problem is that I have a high volume of standard CSV files and pipe
delimited files. At the moment I have to you the file - import -
delimited | method..

Can this be achieved by adding a new file extension, say *.PCSV which
open and handle like CSV files?

Cheers in advance.
Phil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding a new file extension for Pipe Delimited files

On 12 Jun, 09:30, "NickHK" wrote:
Phil,
Try this. You can change the last argument of GetOpenFilename to true (and
handle the array) to deal with multiple files names.

Private Sub CommandButton1_Click()
Dim FileName As Variant

FileName = Application.GetOpenFilename("Pipe Separated File (*.psv), *.psv",
, , , False)

If FileName < False Then
Workbooks.OpenText FileName, xlDelimited, TextQualifier:=xlDoubleQuote,
Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar:="|"
End If

End Sub

NickHK

wrote in message

oups.com...



Hi All,


Does anybody know a method so that pipe-delimited-separator text files
can be recognised and handle like CSV files in much the same way ( but
without disturbing CSV handling) ?


My problem is that I have a high volume of standard CSV files and pipe
delimited files. At the moment I have to you the file - import -
delimited | method..


Can this be achieved by adding a new file extension, say *.PCSV which
open and handle like CSV files?


Cheers in advance.
Phil- Hide quoted text -


- Show quoted text -



That's great. Thanks for the swift response!! My issue now is that I
can open the .psv file, but when I come to save the document, it won't
allow me to keep the pipe delimited format. Would I need to create
another macro to save it as pipe delimited in exactly the same format?

And any idea's how?

Thanks again.
Phil

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pipe-Delimited CSv File stevieb Excel Discussion (Misc queries) 3 August 7th 08 08:08 PM
How can I convert tab delimited files to pipe delimited? Jeremy Town Excel Discussion (Misc queries) 2 November 15th 07 04:29 PM
Save CSV file as Pipe delimited text file germantim Excel Discussion (Misc queries) 3 August 16th 06 09:52 AM
Import Pipe Delimited File, Parse out certian Fields, create new f StarBoy2000 New Users to Excel 4 July 17th 05 07:36 AM
Save file as text pipe delimited Ashley[_3_] Excel Programming 0 May 5th 04 06:38 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"