ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hard Enter in one column values (https://www.excelbanter.com/excel-discussion-misc-queries/225723-hard-enter-one-column-values.html)

Unnati

Hard Enter in one column values
 
Hi,
I am trying to convert XLS to CSV and then load to Oracle. But in XLS i
have some field value with Carriage Return. So it is making new records. Is
there anyway i can do while converting? I have couple of them coming
frequently.

Joerg Mochikun

Hard Enter in one column values
 
Select your data in Excel, then fire up the VBA Editor (Alt+F11).
Copy following line to the "Immediate" Window and push Enter:
Selection.Replace Chr(10), " "

This will replace all Carriage Returns in the selection with a Space
(substitute " " with "" if you just want to remove).

If you need to do this regularly, you can put it into a proper macro:

Sub RemoveReturns()
Selection.Replace Chr(10), " "
End Sub

Cheers,

Joerg Mochikun

"Unnati" wrote in message
...
Hi,
I am trying to convert XLS to CSV and then load to Oracle. But in XLS i
have some field value with Carriage Return. So it is making new records.
Is
there anyway i can do while converting? I have couple of them coming
frequently.




Dave Peterson

Hard Enter in one column values
 
You could also do the change via the user interface.

Select the range to fix
Edit|replace
what: ctrl-j
with: (space character)
replace all

========
I don't use oracle, but if it supports newlines in its fields, you may want to
change the alt-enter to a unique character (like a |). Import this data into
Oracle and then do something(?) in oracle to change that character back to a
linefeed.

Unnati wrote:

Hi,
I am trying to convert XLS to CSV and then load to Oracle. But in XLS i
have some field value with Carriage Return. So it is making new records. Is
there anyway i can do while converting? I have couple of them coming
frequently.


--

Dave Peterson


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com