473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problems while exporting data using pipe symbols

Hi Frends,

I am facing problems while trying to export data into
pipe format. In fact I am fetching records from mysql database and then
trying to create a text file ( using pipe as delimeter) , intending to
open in Excel.

The data is been inserted from textarea fields, where the
user can write text and may press enter key to format his text
accordingly. Now when the data entered into the database it keeps some
unidentified value so as to keep the formatting. Hence while displaying
the text file I find that lines are seperated according to the format
user gave. Thus creating the problem while opening up in the excel
file.

example:

First Name: Mark [Text Field].
Second Name: Heyden ]Text Field].
Address: xyz (Enter Key pressed)
abc, (Enter Key pressed)
def. (Enter Key pressed)
[TextArea]

Hence the record I expect should be in the text file like,

Mark | Heyden | xyz abc,def.

But I am getting it as

Mark | Heyden | xyz
abc,
def.
I would appreciate if some one can give me the solution
how i can get rid of the situation.

Thanks,
M Heyden.

Feb 2 '06 #1
1 2604
ma*********@gmail.com wrote:
Hi Frends,

I am facing problems while trying to export data into
pipe format. In fact I am fetching records from mysql database and then
trying to create a text file ( using pipe as delimeter) , intending to
open in Excel.

The data is been inserted from textarea fields, where the
user can write text and may press enter key to format his text
accordingly. Now when the data entered into the database it keeps some
unidentified value so as to keep the formatting. Hence while displaying
the text file I find that lines are seperated according to the format
user gave. Thus creating the problem while opening up in the excel
file.

example:

First Name: Mark [Text Field].
Second Name: Heyden ]Text Field].
Address: xyz (Enter Key pressed)
abc, (Enter Key pressed)
def. (Enter Key pressed)
[TextArea]

Hence the record I expect should be in the text file like,

Mark | Heyden | xyz abc,def.

But I am getting it as

Mark | Heyden | xyz
abc,
def.
I would appreciate if some one can give me the solution
how i can get rid of the situation.

Thanks,
M Heyden.

Hi Marc,

I was in the same situation and solved it the poor-man's way. :-)
My problem was that different Excel-versions had different ideas about the
formatting.
My first solution was placing ALL fields between "", and I hoped the ""
could contain the newline.
It turned out that that strategy didn't work out as desired everywhere.
(Depending on Excelversion, import-settings, OS, etc)

I tried tab-delimiter: same problem.

So I changed strategy (to poor man's solution).

Before writing to file:
1) replace \n by **NEWLINE** (or whatever characters you do not expect in
the real textfields)
Now you do not have the annoying newline that makes Excel 'think' you import
a new row.

2) Just import them into excel as usual.

3) In Excel I made a miniscule macro that replace any **NEWLINE** with \n in
all fields. (Just a replace in VBscript)
That macro was placed under a button 'format me' in the excellsheet.

I know this solution sucks, but it worked.

I expected the customer to say: 'Your solution sucks, I do not want to press
your stupid button!', but they thought the button was actually cool, so I
got away with it. ;-)

Not sure if it helps in your situation.

If you know what the targetenvironment is (OS, excellversion,etc) you might
try to find an encoding and delimiter that works for that situation. (like
using , as delimitter and place all fields in ''). In some situation excell
accepts the newline within quotes, but I do not remember the details.)

Regards,
Erwin Moller
Feb 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: steve | last post by:
hi, during a full export of my export of a (Release 9.2.0.4.0 - Production ) database i'm getting the following: I have been thru metalink, and can find nothing that is exactly the same, even...
2
by: Gordan | last post by:
Hi! I have a voting pool and when user hits "vote" I want a pop up to appear with results So I put in form action (window.open(.......)) and the pop up appears but the main page changes to...
3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
3
by: Bilgehan.Balban | last post by:
Hi, My observation was that a function with `inline' qualifier has file scope in C++ and it's symbol is not exported. Contrary to this, in C an `inline' function symbol is exported, unless it...
2
by: goodnamesalltaken | last post by:
Hello fellow python users, I've been working on a basic implementation of a privilege separated web server, and I've goto the point of running a basic cgi script. Basically when the execCGI...
12
by: 2b|!2b==? | last post by:
I want to export my C++ classes in a DLL, using ordinal # - rather than by name. Will anyone care to enumerate through the steps required to do this? I am already failiar with exporting classes...
1
by: F. | last post by:
Hello, I have problems making python on CentOS 5. Seems that can not find something. I can not find the problem. Where is the problem?
2
by: GerdBrix | last post by:
Hi, I have a few legacy systems to which I need to export data from SQL server 2000. The export should be done every one or two hours, so there's much time for little data ;-) My first idea to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.