Reformatting(?) some text
Thread poster: Lincoln Hui
Lincoln Hui
Lincoln Hui  Identity Verified
Hong Kong
Local time: 21:24
Member
Chinese to English
+ ...
Feb 10, 2015

I'm trying to find a way to reformat text that looks like this:
a blah blah blah blah blah blah blah

into this:
a blah
a blah
a blah
a blah
a blah
a blah
a blah


This has to do with a couple of files that are needed for my input method as below. Basically, I'm trying to reformat file a as below:
... See more
I'm trying to find a way to reformat text that looks like this:
a blah blah blah blah blah blah blah

into this:
a blah
a blah
a blah
a blah
a blah
a blah
a blah


This has to do with a couple of files that are needed for my input method as below. Basically, I'm trying to reformat file a as below:
https://drive.google.com/file/d/0B5IIMsUNTTAFUUpQNkpEcW93VmM/view?usp=sharing

so that it looks like file b as below (open in Wordpad/Notepad++):
https://drive.google.com/file/d/0B5IIMsUNTTAFVDJHSjVUakdoR3M/view?usp=sharing

Thanks.

[Edited at 2015-02-10 22:23 GMT]
Collapse


 
Tony M
Tony M
France
Local time: 14:24
Member
French to English
+ ...
SITE LOCALIZER
To start with... Feb 10, 2015

After your aai etc, is there a tab character? And are those simple spaces between the Chinese
characters?

If so, I'd start by replacing the tabs with some other unique character combination, and then the spaces with tabs, which would then let you convert the text to a table, with each Chinese character on a separate line, and the EN 'source text' in the first cell of each section of the first column.

I don't quite know where to go from there...

Unles
... See more
After your aai etc, is there a tab character? And are those simple spaces between the Chinese
characters?

If so, I'd start by replacing the tabs with some other unique character combination, and then the spaces with tabs, which would then let you convert the text to a table, with each Chinese character on a separate line, and the EN 'source text' in the first cell of each section of the first column.

I don't quite know where to go from there...

Unless you could do the opposite, and start by inserting 'source text TAB' to replace each space; but I think you might need a little macro or script to automate that.

Or copy the table across into Excel so you can use 'fill down' in some way? Is there a 'fill down until not empty' command?!
Collapse


 
Lincoln Hui
Lincoln Hui  Identity Verified
Hong Kong
Local time: 21:24
Member
Chinese to English
+ ...
TOPIC STARTER
You're a life-saver Feb 10, 2015

Those were actually multiple simple spaces rather than tabs, but a few search and replace still got things done.

Now I've got things in a table and I can do the rest by hand by transposing rows to columns in Excel. Still a lot of work but it's at least feasible now!


 
Dan Lucas
Dan Lucas  Identity Verified
United Kingdom
Local time: 13:24
Member (2014)
Japanese to English
Try a different tool Feb 10, 2015

Lincoln Hui wrote:
Still a lot of work but it's at least feasible now!

Lincoln, don't do this manually. What you're trying to do is a common transform operation in data wrangling that goes by a number of names, but usually something like reshaping from "wide to long" or "wide to tall". Once you've got the data into Excel the rest should be easy. Tableau's Excel add-on for reshaping data is useful for this - download it here:
http://kb.tableau.com/articles/knowledgebase/addin-reshaping-data-excel

But if you google the phrases above you will find ways to do it without the add-in such as this:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_26549515.html

and this:
http://blog.contextures.com/archives/2011/07/20/normalize-data-for-excel-pivot-table/

Dan


 
Lincoln Hui
Lincoln Hui  Identity Verified
Hong Kong
Local time: 21:24
Member
Chinese to English
+ ...
TOPIC STARTER
Fantastic Feb 10, 2015

Thanks Tony and Dan - the pivot table's exactly what I needed.

This is what you get when you've never bothered to learn the finer points of MS Office.

[Edited at 2015-02-10 23:29 GMT]


 


To report site rules violations or get help, contact a site moderator:

Moderator(s) of this forum
Laureana Pavon[Call to this topic]

You can also contact site staff by submitting a support request »

Reformatting(?) some text






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »