Solved

Parsing .TXT file

Posted on 2012-04-10
4
297 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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

685 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