Import Pipe Delimited File, Parse out certian Fields, create new f

In Excel 2000, how do I take a pipe delimited file, strip out column(field) 
6, 10, 11, 21. Then take that data, create a new pipe delimited file, and put 
the stripped 4 fields in columns 4,5,6,7 of a 15 column(field) new pipe 
delimited file?  I want to do this automatically on a file that contains 
1000+ records.
0
7/14/2005 9:49:02 PM
excel.newusers 15348 articles. 2 followers. Follow

4 Replies
524 Views

Similar Articles

[PageSpeed] 17

What goes in columns 1-3 and 8-15 of the new file?


In article <4696CAA0-1DD3-45E3-9627-3FE001611AD2@microsoft.com>,
 "StarBoy2000" <StarBoy2000@discussions.microsoft.com> wrote:

> In Excel 2000, how do I take a pipe delimited file, strip out column(field) 
> 6, 10, 11, 21. Then take that data, create a new pipe delimited file, and put 
> the stripped 4 fields in columns 4,5,6,7 of a 15 column(field) new pipe 
> delimited file?  I want to do this automatically on a file that contains 
> 1000+ records.
0
jemcgimpsey (6723)
7/15/2005 4:25:58 AM
Those columns will be hardcoded with text or left blank (null).  The system 
I'm sending the new file to has to receive a 15 column (piped) file.  

"JE McGimpsey" wrote:

> What goes in columns 1-3 and 8-15 of the new file?
> 
> 
> In article <4696CAA0-1DD3-45E3-9627-3FE001611AD2@microsoft.com>,
>  "StarBoy2000" <StarBoy2000@discussions.microsoft.com> wrote:
> 
> > In Excel 2000, how do I take a pipe delimited file, strip out column(field) 
> > 6, 10, 11, 21. Then take that data, create a new pipe delimited file, and put 
> > the stripped 4 fields in columns 4,5,6,7 of a 15 column(field) new pipe 
> > delimited file?  I want to do this automatically on a file that contains 
> > 1000+ records.
> 
0
7/15/2005 12:26:03 PM
One way:

    Public Sub PipeFileTransform()
           Const sDELIMITER As String = "|"
           Dim vArr As Variant
           Dim nFileIn As Long
           Dim nFileOut As Long
           Dim sPre As String
           Dim sPost As String
           Dim sInput As String
           Dim sOutput As String
           
           sPre = String(3, sDELIMITER)
           sPost = String(8, sDELIMITER)
           
           nFileIn = FreeFile
           Open "Test1.txt" For Input As #nFileIn
           nFileOut = FreeFile
           Open "Test2.txt" For Output As #nFileOut
           Do While Not EOF(1)
               Line Input #1, sInput
               vArr = Split(sInput, "|")
               sOutput = sPre & vArr(5) & sDELIMITER & vArr(9) & _
                           sDELIMITER & vArr(10) & sDELIMITER & _
                           vArr(20) & sPost
              Print #2, sOutput
           Loop
           Close #nFileIn
           Close #nFileOut
       End Sub

Adjust sPre and sPost as desired. Note that Split() is a VBA6 function. 
If you need this to work with WinXL97 or MacXL, you'll need to roll your 
own Split function.



In article <EB500164-E9F8-4DA0-BDB8-781E5D80C24D@microsoft.com>,
 "StarBoy2000" <StarBoy2000@discussions.microsoft.com> wrote:

> Those columns will be hardcoded with text or left blank (null).  The system 
> I'm sending the new file to has to receive a 15 column (piped) file.
0
jemcgimpsey (6723)
7/17/2005 6:19:34 AM
It doesn't make any difference in this case, but for foolish 
consistency, the line below should have been:

            vArr = Split(sInput, sDELIMITER)



In article <jemcgimpsey-E224F8.00193417072005@msnews.microsoft.com>,
 JE McGimpsey <jemcgimpsey@mvps.org> wrote:


>                vArr = Split(sInput, "|")
0
jemcgimpsey (6723)
7/17/2005 6:36:43 AM
Reply:

Similar Artilces:

Tool to Create High-Color Icons
Can anyone recommend a good tool for creating high-color icons for my projects. I have Corel Photo-Paint. It's pretty powerful but I can't do very good shading by hand. Aren't there some tools out there that will render 3D shading? Thanks for any suggestions. -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com I would recommend XaraX (www.xara.com). You can produce nice shaded stuff like on the page: http://www.terra-informatica.org/htmlayout/ You should save (export) you images as PNGs (with or without alpha channel) and use 2DIB.exe (http://www.terra-in...

Importing messages #6
I have a backup disk that I would like to impport from, but obviously I do not know how. When I double-click a message, it does not recognize which program to use to open it and takes me to an MS site. All of these have a ..dbx extension. Thank you. "Jennifer" <Jennifer@discussions.microsoft.com> wrote in message news:3398C3D3-FDD8-41CB-8F73-C445B56F6CF7@microsoft.com... >I have a backup disk that I would like to impport from, but obviously I do > not know how. When I double-click a message, it does not recognize which > program to use to open it and takes me...

Import and export
Trying to salvage my data and it was suggestd I import and export files, do I need to import and export closed accounts as well? Only if you want them in the new file. In order to export a closed account, you'll need to first specify that it is open in Money. "Mike" <anonymous@discussions.microsoft.com> wrote in message news:269701c3fc78$9f29fcf0$a301280a@phx.gbl... > Trying to salvage my data and it was suggestd I import and > export files, do I need to import and export closed > accounts as well? ...

Importing data
When I import sales data through 3CDaemon, I get cells that I of data that I cannot use in formulas. It is like they are corrupted. But can copy the info from cell to cell, just cannot use in formula (ex. =if(dd04="N",1,0. Formula does not error out, but it makes no difference if N, U, or anything else is in dd04. It answers back 0. How can I fix this ? Just a couple of guesses (I have no idea what 3CDaemon is). First, Get a copy of Chip Pearson's CellView Addin so that you can really determine what's in DD04): http://www.cpearson.com/excel/CellView.htm Second, ...

Import TransferIN into TransferOUT... its possible?
Hi, I have RMS 1.3, its possible to import a transfer in of one store into transfer out on my store? Thanks in advance. Aldo, If you are running HQ, it does this for you, on the next connect to HQ. -- * Get Secure! - www.microsoft.com/security You must be using Outlook Express or some other type of newsgroup reader to see and download the file attachment. If you are not using a reader, follow the link below to setup Outlook Express. Click on "Open with newsreader" under the MS Retail Management System on the right. http://tinyurl.com/75bgz ********** "Aldo" <...

Opening Lotus *.123 files in Excel
Is there a convertion filter for opening Lotus *.123 files in Excel. I can convert *.wk? files, but I am unable to open *.123 (Lotus 1-2-3 Release 9 for Windows) files "Jim Warren" <Jim Warren@discussions.microsoft.com> wrote... >Is there a convertion filter for opening Lotus *.123 files in Excel. >I can convert *.wk? files, but I am unable to open *.123 (Lotus 1-2-3 >Release 9 for Windows) files The .wk? file formats predated Microsoft securing +90% market share, so way back then they had to compete in terms of interoperability. The .123 file format came after Mi...

Make field Invisible/Visable
I am trying to make a field visible (EmpEndDate) if the EmployeeStatus field is Inactive. I would like it to be invisible if the field is active or null. I have read other posts but still need some assistance. I have the below code so far but it is not working quite right. When I change one record, they all change so I dont know if I need to incude the ID (AutoNumber) in the code? Private Sub EmployeeStatus_AfterUpdate() If Me.EmployeeStatus = "Inactive" Then Me.EmpEndDate.Visible = True Else Me.EmployeeStatus = "Active" Me.EmpEndDate.Visible = False ...

Creating mailboxes via command line.
In Exchange 5.5 I used a CSV import to create mailboxes from a script. Is there an equivalent (or better) functionailty in Exchange 2003? I use dsadd to create the user account on the 2003 AD server but cannot figure out how to create the mailbox. Any ideas are appreciated. I did look on the windows scripting page, but did not see much that was useful. David Eaton David: You can use LDIFDE or CSVDE. Do some research on both. Neither are as friendly as the import/export features of Exchange 5.5. I personally would recommend learning some scripting and using VBS instead. Do a search for ...

excel 97 xml import
I have Excel 97 and need to import a XML file. I don't know vba. Slinger XL97 was written way before XML therefore it will not handle it. Only XL2003 (Individual product or from Office Pro) will recognise and handle XML import/export -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "Slinger" <Slinger@discussions.microsoft.com> wrote in message news:D1D9952E-F741-4B11-8040-B27B34F382BE@microsoft.com... >I have Excel 97 and need to import a XML file. I don't know vba. ...

How I import data without truncating zero in the beginning
I am importing data from text file to access database but it is truncating all the zeros if they come in the starting.... please help me to resolve this problem as there is a field name telephone number and I need zero in the starting to distinguish between local and international calls. Remplace them by "+" (normaly it's the same) "Mohsin Habib" <MohsinHabib@discussions.microsoft.com> a écrit dans le message de news:8B32A18C-E88B-4259-8CAE-332EB821883C@microsoft.com... >I am importing data from text file to access database but it is truncating > ...

New Opportunity Product (Error on Page)
We are trying to add products to an opportunity, but when we hit the button "New Opportunity Product" on the Products page of the Opportunity module the only thing we get is an "Error on Page" in the bottom left-hand corner. Has anyone experienced this before? If so, any idea(s) how to fix it? Thanks, Tim Do you have a Price list and matching currency associated to the Opportunity? do you have any javascript running on the Opportunity or Opportunity Product? "Tim" wrote: > We are trying to add products to an opportunity, but when we hit the button &g...

Importing JEs through the Table Import
Is there a way to import JEs throught the table import. If so, how is this accomplished? Please help! Thank you! If you have access to table import you must also own integration manager. either way, yes, you can import transactions. please give me a call at 214-373-8550 and we can walk through the process. Leslie "Christina" wrote: > Is there a way to import JEs throught the table import. If so, how is this > accomplished? Please help! Thank you! You can use Table Import but Integration Manager is much, much easier to use. If you can use Table Import, you own Inte...

recover damaged excel file
I have a workbook creater with Excel 2000 just a few days ago but there's no way to open it. Coud anyone give me any suggestion? Hi, what message do you get?, ask your IT department usually they backup all the files, did you send the file to somebody? "Nora_Italy" wrote: > I have a workbook creater with Excel 2000 just a few days ago but there's no > way to open it. Coud anyone give me any suggestion? Thank you Eduardo. I don't get any error message, the file just doesn't open. Unfortunatately we backup files only once a month and I created...

Importing Dynamic data
Hi I have some tables in various xl files, call the files a,b and c. I want to import all these into a single xl file called e. If changes are made to a,b or c I want it to automatically update e. I have used the import function in d but if I change a,b or c to see the change I have to select the data in d and press refresh. Furthermore when I refresh d i have to have files a,b and c open otherwise it says connection lossed and is unable to refresh the data. Can someone explain to me in simple terms what I have to do in order to get the data automatically updated without having to alway...

Importing a CSV file
Hi, When I try to import a CSV file into Outlook, it says I have to first install the DATA1.MSI file from my windows XP installation disk. I looked at my installation disk and here doesn't seem to be such a file. How can I import? Thanks, Randy If you have the correct installation disk, then all you need do is run the Office setup - Add/Remove options and add the Outlook import filters. Karl -- ____________________________________________________________ Karl Timmermans - The Claxton Group ContactGenie - QuickPort/DataPort/Exporter/Toolkit/Duplicate Contact M...

delimiting w/multiple delimiters?
I have a large database I use that has our item numbers and quantities in the same cell (example: PRODUCTA Q100, and PRODUCTA Q200, etc). It works for me to use the quantities for formula later by doing the "text to columns" and delimiting by Q. Problem is, sometimes the product name also has a Q in it so the delimiting function seperates it incorrectly. Like: Works: cell A: PRODUCTA Q100 turns to-- cell A: PRODUCTA cell B: 100 Doesn't work when: cell F: PRODUCTQA Q100 turns to-- cell A: PRODUCT cell B: A cell C:100 The LAST Q# is always the one I w...

Create pivot table from 2 worksheets
How do I create 1 pivot table that draws data from 2 worksheets? -- MichaelKoh ------------------------------------------------------------------------ MichaelKoh's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=22956 View this thread: http://www.excelforum.com/showthread.php?threadid=480774 You can create a pivot table from data on separate sheets (multiple consolidation ranges), but the results may not be exactly what you want. There's more information here: http://www.contextures.com/xlPivot08.html MichaelKoh wrote: > How do I create 1 pivot ...

Import DB from CRM 1.2 to 3.0
Hi to all, How can I import the DB or data from CRM 1.2 to new CRM 3.0? Now my CRM DB are on SQL2000 server. Thank and regards. Augusto You should really upgrade CRM1.2 to 3.0. The data structutres are different enough that doing a migration would be pretty painful. Any reason not to upgrade? "IGBA75" <a.crippa@ieti.biz> wrote in message news:%23c97ZdkXGHA.3660@TK2MSFTNGP04.phx.gbl... > Hi to all, > > How can I import the DB or data from CRM 1.2 to new CRM 3.0? > Now my CRM DB are on SQL2000 server. > > Thank and regards. > Augusto > ...

Move Public Fldr DB to new Storage Group
Hi, I'm hoping that I can do this.... When our new Exchange 2007 server was set up, the public folder database was left in the default first storage group. As we're evolving with this installation, we see a need to move the public folder database to a different storage group. Some things I've read lead me to beleive that it may not be possible. So I have 2 questions: 1) Is it possible to move the public folder database to another storage group? and 2) If it is possible, how? TIA Chris On Fri, 9 Apr 2010 11:17:02 -0700, CCerer <CCerer@discussions.microsoft.c...

create a new formula?
I am using the nested functions below "=if(vlookup(1, GRID, 3,false) = 0, (1, GRID, 4, false), (1, GRID, 3, false))" i.e for the row with the digit one in its first column return the value in the third column else if empty return the value in the fourth column. my problem is i am repeatedly using the line above exactly only changing the value i am searching for (1 in this case )) so ideally i'd like to do something like define myformula(X) = if(vlookup(X, GRID, 3,false) = 0, (X, GRID, 4, false), (X, GRID, 3, false)) is this possible????????? Assuming that the third ...

why are my important emails going into junk email
I posted on outlook general and didn't get a response. so I looked here and there was no clue as to what is happening. I am using outlook 2007 on the desktop. now any mail coming in from facebook is going to junk email. also my zdnet newsletter is going there also. I have added their domain to the safe list but they are still going to junk. this probably started the other day when I got outlook 2003 going on my laptop so I could see my emails when I am away from home. I did lower the category for junk mail one item but that didn't help either. don't know what...

MSG: No more new fonts may be added to this workbook
I get the above message while I'm working with my excel 2002 file. It's a big file with lots of charts. When I copy and paste a chart I get the above message and the program locks (although I can usually save and re-open). But I don't understand what this message means. Can anyone help? I'm not too fussy about formatting and have tried clearing formats etc. but it only buys me a couple more charts to add. Thanks, Dan As answered in .charting -- Jon Peltier has some information on this in his Charting FAQ article: http://pubs.logicalexpressions.com/Pub0009/LPMA...

Back up file function no longer works
Although we have previously had no problem with running a backup of our Money 2002 file on file close, we now get an error message saying that "The operation cannot be performed." The filename is the same it always was. Any ideas? ...

how can i import worksheets from multiple workbooks
Hi, I have a bunch of workbooks that all used the same template and were filled out for each week of the year. They all have a "totals" sheet the collects all the important data within. What i want to do is create a macro that imports that totals page, or a section of it from a bunch of these different workbooks, say all the ones in january or maybe the entire years worth so i can do some more analysis. my VBA skills are terrible but i am learning slowly. Any help would be appreciated. Hi David You can start here http://www.rondebruin.nl/copy3.htm -- Regards Ron de Bruin h...

log files in folder MDBDATA
is it safe to delete the log files that's in the folder MDBDATA? fanman36 wrote: > is it safe to delete the log files that's in the folder MDBDATA? This files will be deleted automatically after performing a full backup with NTBackup. They are used for recovery. -- Dana http://www.woodcontour.com Solid wood and stone PC Peripherals On Fri, 16 Sep 2005 22:15:01 -0700, "fanman36" <fanman36@discussions.microsoft.com> wrote: >is it safe to delete the log files that's in the folder MDBDATA? No, you should not manually delete those files. Use an Exchange awar...