Sponsored Content
Top Forums Shell Programming and Scripting Parsing string using specific delimiter Post 302238088 by primp on Friday 19th of September 2008 02:51:17 AM
Old 09-19-2008
Parsing string using specific delimiter

Hi,

I'm wondering what is the best way to parse out a long string that has a specific deliminator and outputting each token between the delim on a newline?

i.e. input
text1,text2,text3,tex4

i.e. output
text1
text2
text3
text4
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to differentiate columns of a file in perl with no specific delimiter

Hi everybody, This time I am having one issue in perl. I have to create comma separated file using the following type of information. The problem is the columns do not have any specific delimiter. So while using split I am getting different value. Some where it is space(S) and some where it is... (9 Replies)
Discussion started by: Amiya Rath
9 Replies

2. UNIX for Dummies Questions & Answers

Parsing using a Delimiter

Hi, i have a string in format of text1.text2.text3 . how do i parse it using . as delimiter . i understand this can be done by tr .However i am trying to assign these to different variables such as a=text1 b=text2 c=text3 etc? how can i do it (3 Replies)
Discussion started by: paritoshc
3 Replies

3. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

4. Shell Programming and Scripting

How to remove delimiter from specific column?

I have 5 column in sample txt file where in i have to create report based upon 1,3 and 5 th column.. I have : in first and third coulmn. But I want to retain the colon of fifth coulmn and remove the colon of first column.. 5th column contains String message (for example,... (7 Replies)
Discussion started by: Shirisha
7 Replies

5. Shell Programming and Scripting

parsing filename and grabbing specific string patterns

Hi guys...Wow I just composed a huge post and it got erased as I was logged out automatically Anyways I hope someone can help me out here. So the task I'm working on is like this I have a bunch of files that I care about sitting in a directory say $HOME/files Now my job is to go and loop... (6 Replies)
Discussion started by: rukasetsuna
6 Replies

6. Shell Programming and Scripting

Html parsing - get line after specific string till a point

Hi all :) It sounds complex, for example I want to find the whole html file (there are 5 entries of this string and I need to get all of them) for the string "<td class="contentheading" width="100%">", get the next line from it only till the point that says "</td>", plus removing \t (tabs) ... (6 Replies)
Discussion started by: hakermania
6 Replies

7. Shell Programming and Scripting

Adding String at specific postition of a delimiter

I have a file containing data lines: 1|14|CONSTANT||11111111||00887722||30/04/2012|E|O|X||||20120528093654-30.04.2012|STA11ACT|ddts555S||||00001|rrttbbggcc| 1|15|CONSTANT||22222222||00887722||30/04/2012|E|O|X||||20120528093654-30.04.2012|rrtha772|llkis000||||00001|AAEtbbggcc| I want to add a... (3 Replies)
Discussion started by: pparthiv
3 Replies

8. Shell Programming and Scripting

Specific string parsing in Linux/UNIX

Hi, I have a string which can be completely unstructred. I am looking to parse out values within that String. Here is an example <Random Strings> String1=<some number a> String2=<some number b> String3=<some number c> Satish=<some number d> String4=<some number e> I only want to parse out... (1 Reply)
Discussion started by: satishrao
1 Replies

9. UNIX for Advanced & Expert Users

Inserting delimiter after a specific number of chars

Hello guys, I have a problem where I need to add a delimiter, that can be | for example, after each 28000 chars. The problem is that sometimes 1 row, which should contain 28000 chars is split in 2, so I want to put the delimiter after each 28000 so I will know the end of each row. Please... (2 Replies)
Discussion started by: Diogo R Jesus
2 Replies

10. Shell Programming and Scripting

Replace specific column delimiter

Hi All, I have a file with a pipe delimiter. I need to replace the delimiter with html tags. I managed to get all the delimiters replaced along with first and last but the requirement is that I need to change 7th delimiter with slight change. File1: ... (2 Replies)
Discussion started by: shash
2 Replies
XML::TMX::Writer(3pm)					User Contributed Perl Documentation				     XML::TMX::Writer(3pm)

NAME
XML::TMX::Writer - Perl extension for writing TMX files SYNOPSIS
use XML::TMX::Writer; my $tmx = new XML::TMX::Writer(); $tmx->start_tmx(id => 'paulojjs'); $tmx->add_tu(SRCLANG => 'en', 'en' => 'some text', 'pt' => 'algum texto'); $tmx->add_tu(SRCLANG => 'en', 'en' => 'some text', 'pt' => 'algum texto', -note => [32, 34 ], -prop => { q => 23, aut => "jj"} ); $tmx->end_tmx(); DESCRIPTION
This module provides a simple way for writing TMX files. METHODS
The following methods are available: new $tmx = new XML::TMX::Writer(); Creates a new XML::TMX::Writer object start_tmx $tmx->start_tmx(-output => 'some_file.tmx'); Begins a TMX file. Several options are available: -output Output of the TMX, if none is defined stdout is used by default. tool Tool used to create the TMX. Defaults to 'XML::TMX::Writer' toolversion Some version identification of the tool used to create the TMX. Defaults to the current module version segtype Segment type used in the <tu> elements. Possible values are block, paragraph, sentence and phrase. Defaults to sentence. srctmf Specifies the format of the translation memory file from which the TMX document or segment thereof have been generated. adminlang Specifies the default language for the administrative and informative elements <note> and <prop>. srclang Specifies the language of the source text. If a <tu> element does not have a srclang attribute specified, it uses the one defined in the <header> element. Defaults to *all*. datatype Specifies the type of data contained in the element. Depending on that type, you may apply different processes to the data. The recommended values for the datatype attribute are as follow (this list is not exhaustive): unknown undefined alptext WinJoust data cdf Channel Definition Format cmx Corel CMX Format cpp C and C++ style text hptag HP-Tag html HTML, DHTML, etc interleaf Interleaf documents ipf IPF/BookMaster java Java, source and property files javascript JavaScript, ECMAScript scripts lisp Lisp mif Framemaker MIF, MML, etc opentag OpenTag data pascal Pascal, Delphi style text plaintext Plain text (default) pm PageMaker rtf Rich Text Format sgml SGML stf-f S-Tagger for FrameMaker stf-i S-Tagger for Interleaf transit Transit data vbscript Visual Basic scripts winres Windows resources from RC, DLL, EXE xml XML xptag Quark XPressTag srcencoding All TMX documents are in Unicode. However, it is sometimes useful to know what code set was used to encode text that was converted to Unicode for purposes of interchange. This option specifies the original or preferred code set of the data of the element in case it is to be re-encoded in a non-Unicode code set. Defaults to none. id Specifies the identifier of the user who created the element. Defaults to none. -note A reference to a list of notes to be added in the header. -prop A reference fo a hash of properties to be added in the header. Keys are used as the "type" attribute, value as the tag contents. add_tu $tmx->add_tu(srclang => LANG1, LANG1 => 'text1', LANG2 => 'text2'); $tmx->add_tu(srclang => LANG1, LANG1 => 'text1', LANG2 => 'text2', -note => ["value1", ## notes "value2"], -prop => { type1 => ["value1","value"], #multiple values _ => 'value2', # anonymound properties typen => ["valuen"],} ); Adds a translation unit to the TMX file. Several optional labels can be specified: id Specifies an identifier for the <tu> element. Its value is not defined by the standard (it could be unique or not, numeric or alphanumeric, etc.). srcencoding Same meaning as told in start_tmx method. datatype Same meaning as told in start_tmx method. segtype Same meaning as told in start_tmx method. srclang Same meaning as told in start_tmx method. end_tmx $tmx->end_tmx(); Ends the TMX file, closing file handles if necessary. SEE ALSO
TMX Specification <http://www.lisa.org/tmx/tmx.htm> AUTHOR
Paulo Jorge Jesus Silva, <paulojjs@bragatel.pt> Alberto Simo~es, <albie@alfarrabio.di.uminho.pt> COPYRIGHT AND LICENSE
Copyright 2003 by Projecto Natura This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-05 XML::TMX::Writer(3pm)
All times are GMT -4. The time now is 06:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy