[Solved] Inputting text from an email to Calc

Discuss the spreadsheet application
Post Reply
radardoug
Posts: 6
Joined: Mon Mar 29, 2021 10:02 am

[Solved] Inputting text from an email to Calc

Post by radardoug »

Hi,
I am working on an application where I want import cells from an email. I thought if I used the Windows clipboard and formatted the text string as csv, it would import into multiple cells, but no.
So is there a way to take a text string from the windows clipboard and split it into multiple cells? What special formatting needs to be applied to the text string?

See my message near the end of this for how I solved it.
Last edited by robleyd on Tue Mar 30, 2021 11:10 am, edited 2 times in total.
Reason: Add green tick
Open Office 4.1.7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Inputting text from an email to Calc

Post by Villeroy »

If it is only one row (paragraph), everything goes into one cell.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Inputting text from an email to Calc

Post by Bill »

The Text Import dialog can be used to split the text, but it won't appear if only one paragraph of text is pasted in Calc. To invoke the Text Import dialog, copy two paragraphs (one can be blank) and paste in Calc using Edit > Paste Special > Unformatted Text.
AOO 4.1.14 on Ubuntu MATE 22.04
radardoug
Posts: 6
Joined: Mon Mar 29, 2021 10:02 am

Re: Inputting text from an email to Calc

Post by radardoug »

So it turns out if you have your data separated one item per line then it will paste in vertically in separate cells. But I am trying to paste horizontally. Any body got any thought on that?
By the way, it will do that without Paste special.
Open Office 4.1.7
FJCC
Moderator
Posts: 9279
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Inputting text from an email to Calc

Post by FJCC »

If the text has a character that can be used as a field separator, you can use the menu Data -> Text To Columns after initially pasting the data into a single column.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
radardoug
Posts: 6
Joined: Mon Mar 29, 2021 10:02 am

Re: Inputting text from an email to Calc

Post by radardoug »

Tried that, doesn't work.
Open Office 4.1.7
radardoug
Posts: 6
Joined: Mon Mar 29, 2021 10:02 am

Re: Inputting text from an email to Calc

Post by radardoug »

Probably because its already in a column. I want it in rows, across.
Open Office 4.1.7
User avatar
robleyd
Moderator
Posts: 5086
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Inputting text from an email to Calc

Post by robleyd »

Once pasted into a column you can select, then cut the contents and use the Paste All and Transpose options in Paste Special. See the Help on transposing tables for more information.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
FJCC
Moderator
Posts: 9279
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Inputting text from an email to Calc

Post by FJCC »

Just to make sure that we are talking about the same thing, I entered data in A1:A4 in a comma separated format. I then copied to over to D1:D4 and applied Text To Columns. Normally, you would not copy the data to a different location but I wanted to show the before and after states.
Attachments
Text_to_columns.ods
(10.8 KiB) Downloaded 127 times
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
radardoug
Posts: 6
Joined: Mon Mar 29, 2021 10:02 am

Re: Inputting text from an email to Calc

Post by radardoug »

Just to finish on this, so if you format your text with a tab character (9) in between each item, and finish with a CR character (13),it works beautifully.
You need to use Paste Special.
Open Office 4.1.7
Bill
Volunteer
Posts: 8934
Joined: Sat Nov 24, 2007 6:48 am

Re: Inputting text from an email to Calc

Post by Bill »

radardoug wrote:Just to finish on this, so if you format your text with a tab character (9) in between each item, and finish with a CR character (13),it works beautifully.
You need to use Paste Special.
That's right. A CR in pasted text starts a new row in Calc and separator characters split the text in each row into columns. If you don't use Paste Special, then the text in each row is pasted in one cell. If you use Paste Special, then the Text Import dialog appears and you can choose the separator character that splits the text.
AOO 4.1.14 on Ubuntu MATE 22.04
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Inputting text from an email to Calc

Post by John_Ha »

radardoug wrote:I want import cells from an email. I thought if I used the Windows clipboard and formatted the text string as csv, it would import into multiple cells, but no.
So, is there a way to take a text string from the windows clipboard and split it into multiple cells?
1. Save the data as fred.txt (or fred.csv), using a csv format.
2. Start Calc.
3. File > Open ..., and navigate to fred.txt.
The data is inserted as defined by the csv format used.
4. Save as a .ods file.

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
radardoug
Posts: 6
Joined: Mon Mar 29, 2021 10:02 am

Re: Inputting text from an email to Calc

Post by radardoug »

Sorry, my problem is a little more complicated and that solution wont work, but my current solution is looking good.
Open Office 4.1.7
Post Reply