saving as csv newline inserted

classic Classic list List threaded Threaded
5 messages Options
Uwe Brauer Uwe Brauer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

saving as csv newline inserted


Hi

I have an excel (xls) file which I open with scalc (5.3)
and save it as csv

Unfortunately it looks like

Field1,Field2,Field3,Field4,Field5
"Name","05329954A
           ",0.55,0.75,1.3

Instead of

Field1,Field2,Field3,Field4,Field5
"Name","05329954A ",0.55,0.75,1.3


The reason is that in the first column there is a after name a space
which is translated to a newline when exporting.

How can I get rid of this unwanted newline?
I tried to format the cells but it seemed not to have worked.
Thanks

Uwe Brauer


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Bruce Hohl Bruce Hohl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: saving as csv newline inserted

It appears that the actual contents of Field2 = 05329954A\n where '\n' is a
RETURN (not a TAB).  I was able to remove the \n by (1) select/highlight
the column containing Field2, (2) open Data > Text to Columns, (3) Under
'Separator Options' set Y=Separated by, Y=Other as \n then click 'OK'.  Now
save as CSV.

On Wed, Jun 21, 2017 at 8:52 AM, Uwe Brauer <[hidden email]> wrote:

>
> Hi
>
> I have an excel (xls) file which I open with scalc (5.3)
> and save it as csv
>
> Unfortunately it looks like
>
> Field1,Field2,Field3,Field4,Field5
> "Name","05329954A
>            ",0.55,0.75,1.3
>
> Instead of
>
> Field1,Field2,Field3,Field4,Field5
> "Name","05329954A ",0.55,0.75,1.3
>
>
> The reason is that in the first column there is a after name a space
> which is translated to a newline when exporting.
>
> How can I get rid of this unwanted newline?
> I tried to format the cells but it seemed not to have worked.
> Thanks
>
> Uwe Brauer
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-
> unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
jorge-2 jorge-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: saving as csv newline inserted

In reply to this post by Uwe Brauer
Hi Uwe and all:

        I suggest:

a) Open the file as is: csv
b) Mark the column that content all the information
c) Use: Menu, Edit, Search and Replace ... click there
d) In the window opened: In the first row for input what to search,
input and "space" with spacebar
e) In the second row for input what to replace, keep without input
f) Apply the option Replace All
g) Now if all is good, you are eliminate the space after "name" field
h) Save the file again as csv
i) Now you can close the file and open again or use the option: Menu,
Data, Text to Column to split the fields in the column

I hope this help,

--
Atentamente,

Jorge Rodríguez


El mié, 21-06-2017 a las 12:52 +0000, Uwe Brauer escribió:

> Hi
>
> I have an excel (xls) file which I open with scalc (5.3)
> and save it as csv
>
> Unfortunately it looks like
>
> Field1,Field2,Field3,Field4,Field5
> "Name","05329954A
>            ",0.55,0.75,1.3
>
> Instead of
>
> Field1,Field2,Field3,Field4,Field5
> "Name","05329954A ",0.55,0.75,1.3
>
>
> The reason is that in the first column there is a after name a space
> which is translated to a newline when exporting.
>
> How can I get rid of this unwanted newline?
> I tried to format the cells but it seemed not to have worked.
> Thanks
>
> Uwe Brauer
>
>


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Uwe Brauer Uwe Brauer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: saving as csv newline inserted

In reply to this post by Bruce Hohl
>>> "Bruce" == Bruce Hohl <[hidden email]> writes:

   > It appears that the actual contents of Field2 = 05329954A\n where '\n' is a
   > RETURN (not a TAB).  I was able to remove the \n by (1) select/highlight
   > the column containing Field2, (2) open Data > Text to Columns, (3) Under
   > 'Separator Options' set Y=Separated by, Y=Other as \n then click 'OK'.  Now
   > save as CSV.

Thanks, that works nicely. I don't know how the heck the \n entered, but
at least I know how to deal with it. thanks


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Uwe Brauer Uwe Brauer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: saving as csv newline inserted

In reply to this post by jorge-2
>>> "jorge" == jorge  <[hidden email]> writes:

   > Hi Uwe and all:
   > I suggest:

   > a) Open the file as is: csv
   > b) Mark the column that content all the information
   > c) Use: Menu, Edit, Search and Replace ... click there
   > d) In the window opened: In the first row for input what to search,
   > input and "space" with spacebar
   > e) In the second row for input what to replace, keep without input
   > f) Apply the option Replace All
   > g) Now if all is good, you are eliminate the space after "name" field
   > h) Save the file again as csv
   > i) Now you can close the file and open again or use the option: Menu,
   > Data, Text to Column to split the fields in the column

Thanks, I did it with replace regexp using \n which also worked nicely.
I will keep in mind you suggestion for other cases, thanks
   > I hope this help,


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Loading...