Solved

Parsing .TXT file

Posted on 2012-04-10
4
298 Views
Last Modified: 2012-04-18
Hello Experts,

I have received and .TXT files from client which needs to be translated. For translation, we need to send it in word two column table format.
The .TXT file contains different cases like below....
Also, Column1 and 3 needs to be highlighted in yellow.

Case 1:
TEST_DATE_TEST      :   "THIS IS SAMPLE TEXT", //test_date_test
Word Table Format should be...
Column1:  TEST_DATE_TEST      :  
Column2:  "THIS IS SAMPLE TEXT"
Column3: //test_date_test

Case 2:
testgroup.name.label=Name
Column1:  testgroup.name.label=  
Column2:  Name

Case 3:
testbody.error=An Error has occurred.<br>Please contact your system administrator about this error.
Column1: testbody.error=
Column2:  An Error has occurred.<br>Please contact your system administrator about this error.  ....Highlight in yellow the tags appearing between like <br>

Can you please provide any reference macro or Perl script or XSLT to achieved this.

Thanks in Advance,
Shailesh
0
Comment
Question by:ShaileshShinde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:yogsoft
ID: 37831325
You can use first import the data in Excel file using text file import feature under Data tab.
To perform this use below steps:

1. Go to Data tab and select From Text icon and select text file.
2. On text import wizard select Delimited option in Step 1
3. Select Delimiters and add = as delimiter in Other text box and click on Finish.

This will import the data in different column from where can copy the same to word document.
0
 
LVL 1

Author Comment

by:ShaileshShinde
ID: 37832000
Hello Expert,

This will be a manual task. We need to automate this using Perl, Macro or XSLT. Can you provide the reference for any of these scripts to achieved this process.

Thanks,
Shail
0
 
LVL 7

Accepted Solution

by:
whosbetterthanme earned 500 total points
ID: 37832374
If you need it specifically in Word format, then you can try the Word module:

http://search.cpan.org/~johanl/Win32-Word-Writer-0.03/lib/Win32/Word/Writer.pm

There is sample code there to try.
0
 
LVL 1

Author Closing Comment

by:ShaileshShinde
ID: 37864372
Thanks for the reference!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question