Reformatting(?) some text
Thread poster: Lincoln Hui

Lincoln Hui  Identity Verified
Hong Kong
Local time: 06:07
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:
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]


Direct link Reply with quote
 

Tony M  Identity Verified
France
Local time: 00:07
Member
French to English
+ ...
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...

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?!


Direct link Reply with quote
 

Lincoln Hui  Identity Verified
Hong Kong
Local time: 06:07
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!


Direct link Reply with quote
 

Dan Lucas  Identity Verified
United Kingdom
Local time: 23:07
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


Direct link Reply with quote
 

Lincoln Hui  Identity Verified
Hong Kong
Local time: 06:07
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]


Direct link Reply with quote
 


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


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

Reformatting(?) some text

Advanced search






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 SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »
WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search