importing .csv file as text with line breaks preserved

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig586B1CBB78607B22F70A4995
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I'm trying to import a .csv file where some fields are numbers with
leading zeros, and others have embedded line breaks.

If I name the file with the .csv extension, the line breaks within
fields are preserved, but the leading zeros are missing because every
field is interpreted as General instead of Text.

If I name the file with the .txt extension, I can manually change fields
to Text as appropriate, but I can't figure out any way to preserve the
line breaks within fields.  All line breaks are interpreted as the end
of a row.  The manual aspect of this process is less than ideal too.

What I'm looking for is an automatic import that preserves line breaks
within fields and interprets all fields at Text rather than General.
I'd settle for a somewhat manual process that achieved this also.

Is this possible?

Thanks,
Matt

--------------enig586B1CBB78607B22F70A4995
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/IU9erGgMpZIoLA8RAgZvAJ9ra1BaZJ8oe+f7hmsSxYqpisip2ACgkz6f
EjgnDxuDbM1Kn7PkSR2HF/o=
=f1l4
-----END PGP SIGNATURE-----

--------------enig586B1CBB78607B22F70A4995--

0
mlm1 (1)
7/25/2003 3:40:10 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
553 Views

Similar Articles

[PageSpeed] 28

If you don't mind macros, this will work

Sub ImportText()
Dim RowNdx As Integer
Dim ColNdx As Integer
Dim TempVal As Variant
Dim WholeLine As String
Dim Pos As Integer
Dim NextPos As Integer
Dim SaveColNdx As Integer

FName = Application.GetOpenFilename
Sep = InputBox("Enter the delimiter, for tab delimited data type tab")
If Sep = "tab" Then
    Sep = vbTab
End If

Application.ScreenUpdating = False
'On Error GoTo EndMacro:

SaveColNdx = ActiveCell.Column
RowNdx = ActiveCell.Row

Open FName For Input Access Read As #1

While Not EOF(1)
    Line Input #1, WholeLine
    If Right(WholeLine, 1) <> Sep Then
        WholeLine = WholeLine & Sep
    End If
    ColNdx = SaveColNdx
    Pos = 1
    NextPos = InStr(Pos, WholeLine, Sep)
    While NextPos >= 1
        TempVal = Mid(WholeLine, Pos, NextPos - Pos)
        Cells(RowNdx, ColNdx).Value = "'" & TempVal
        Pos = NextPos + 1
        ColNdx = ColNdx + 1
        NextPos = InStr(Pos, WholeLine, Sep)
    Wend
    RowNdx = RowNdx + 1
Wend

EndMacro:
On Error GoTo 0
Application.ScreenUpdating = True
Close #1

End Sub

Dan E

"Matt McClure" <mlm@aya.yale.edu> wrote in message
news:OVd0LMsUDHA.1484@TK2MSFTNGP12.phx.gbl...


0
7/25/2003 3:54:30 PM
Reply:

Similar Artilces:

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...

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. ...

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...

PUBLISHER TEXT BOX PROBLEMS
HOW DO I MAKE THE BACKGROUND OF A TEXT BOX BLACK AND THE WRITING WHITE? I CAN ONLY SEEM TO MAKE THE WHOLE PAGE BLACK. Three steps are needed. #1 Replace or fix your keyboard so it isn't stuck on Caps Lock. #2 Select the text frame and then color it black. #3 With the text frame selected, use Ctrl-A to highlight all text and click on the text color icon to choose white. -- Ron "cataloguemaker" <cataloguemaker@discussions.microsoft.com> wrote in message news:CCAF0C9F-1FE2-4A76-9431-CCB37FFCFF68@microsoft.com... > HOW DO I MAKE THE BACKGROUND OF A TEXT BOX BLACK AND ...

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 > ...

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...

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 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...

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 > ...

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...

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...

Report not pulling all lines in recordsource
Hello, I have a report that is running off a table (tblSuperCompliance). The report has two subreports on it. What's happening is that there are 4 records on tblSupercompliance. The report will show data for only two of the records. When I delete one of the records that is showing up on the report, one of the other records takes its place in the report. I changed the margins of the report to .25 all the way around. When I change it back to 1", all of the records show up again on the report except that there are 4 hits to each record. Does anyone have an explanation on how this...

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...

import pdf table
What is the best way to inmport a table in a pdf document into excel? Check out: http://www.library.mcgill.ca/edrs/services/publications/how to/PDFtoXLS/PDFtoExcel.html#basicexports HTH Jason Atlanta, GA >-----Original Message----- >What is the best way to inmport a table in a pdf document >into excel? >. > Those directions are for university students that have Adobe Acrobat installed (not just the reader). Though there is a reference immediately above that does refer to the acrobat reader Most people do not have the full Adobe Acrobat software. With just the Acrob...

importing email
Can you import an email into Outlook from Aol.com using high speed internet cable? No. AOL uses proprietary mail format and does not play nicely with others. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Having searched the archives, Ben <mysanity@att.net> typed: | Can you import an email into Outlook from Aol.com using | high speed internet cable? ...

Watermark behind text in the footer?
Hello Excel experts! I'm working on a spreadsheet of about 50 pages in Excel 2003. Ideally, the client would like each page to have a footer with a number 1, 2, 3, etc... in the bottom right hand corner...identifying his content. These are not page numbers he wants, just a simple numbering sequence. I can handle THAT part! LOL What he'd also like is a watermark type of graphic to sit *behind* each number. For example, let's say that he'd like each number super-imposed onto a maple leaf background. I've managed to get the maple leaf background (graphic) to sit on eit...

File Size
Please note that this is not your typical file size question. I have a macro-enabled Excel 2007 file that varies in size from 15-100Mb depending on how much data I populate it with. Every day, in order to email this file out, I alter it by doing the following: Select all tabs (11 in all). Select all cells Copy/Paste Values Delete 5 of the tabs Save as a new Excel Workbook (not macro enabled) The new file size is now roughly 600Kb. However, all of a sudden, the changed file is about 2Mb. I made sure to delete all the excess rows/columns. I deleted the one macro that I h...

Excel 2003
I have a user in a remote location which I am not at with a new Dell pc with Office 2003. He claims excel 2003 won't open his older lotus.123 files. I'm guessing he needs to rerun setup and do either a complete install or install the lotus converters. Can anyone confirm that Excel 2003 can still read lotus 123 files? You may know the last 1-2-3 user alive <g> On Tue, 9 Dec 2003 06:50:20 -0800, "TJD" <anonymous@discussions.microsoft.com> wrote: >I have a user in a remote location which I am not at with >a new Dell pc with Office 2003. He claims ...

Field missing upon XML import
I'm attempting to import an XML file into an Access table. However, if a field name doesn't appear in the first handful of records (not sure of the breaking point), any subsequent instances of the field that may appear later in the file is not imported. For example, let's say there's a field called 'FieldX', but there's no FieldX value (nor tags) for the first 100 rows, but there is in row #101. The result is FieldX is NOT imported. Is this a known issue? Is there a workaround? Phil How are you setting up the import initially. Unless Access has a schema...