Sponsored Content
Top Forums Shell Programming and Scripting Text manipulation help required Post 302465649 by citaylor on Saturday 23rd of October 2010 06:44:52 AM
Old 10-23-2010
sed, awk and tr are good starts for string manipulation in shell script.

You can take input into perl in 2 ways - first you read the string into a VAR:
Code:
read foo

Then you can either pass it into stdin:
Code:
echo $foo | ./myperlscript.pl

In which case you would then use something like this to read it in:
Code:
while (<STDIN>) {
print $_;
...
}

Or you can pass the variable in as a command line argument:
Code:
./myperlscript.pl $foo

In which case you would access it using:
Code:
print $ARGV[0];

I hope this makes things clearer
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Text Manipulation.

Hi I have only ever used awk and sed for basic requirements up until now. I have had to break a log down for multiple purposes. Using awk, sed and a date script. I am left with this: (message id, time of msg attempt, message id, domain name, time of msg completion) ... (4 Replies)
Discussion started by: Icepick
4 Replies

2. UNIX for Dummies Questions & Answers

text manipulation

I am tryin to figure out how to extract interested text from file example.txt blah blah blah a: child1 blah a: child2 blah b: parent1 blah blah blah .... blah a: child21 blah a: child22 blah a: child23 blah b: parent2 this kinda text repeats .. number of children is... (6 Replies)
Discussion started by: rajkishore
6 Replies

3. Shell Programming and Scripting

text manipulation

Hi All; i need to do text processing : I have a file: file1.txt >>>>>>>>>>>> 30 2 23 some 30 2 22 text 30 2 21 xyz 30 2 20 ttttt 30 2 19 ttttt-1 30 2 18 xryz 30 2 17 xyzr 30 2 16 xy111z 30 2 15 xanyyz 30 2 14 xzz 30 2 13 xyy 30 2 0 zzz-w 50 3 25 zzz-w 50 3 12 productw 50 3 10... (4 Replies)
Discussion started by: unlx
4 Replies

4. UNIX for Dummies Questions & Answers

Text Manipulation Help

Hello unix.com, How can I sort a email list by domain name? Example how can I save only ".net" emails from a file? (1 Reply)
Discussion started by: galford
1 Replies

5. UNIX for Dummies Questions & Answers

text manipulation help

Hello again unix.com How can I extract from a large file in format: steve@aol.com steve hawkins Location of this member is bla bla bla sun@hotmail.com Sun Ying This member is using browser bla bla bla to another text in format: steve@aol.com steve hawkins sun@hotmail.com sun ying ... (5 Replies)
Discussion started by: galford
5 Replies

6. UNIX for Dummies Questions & Answers

text manipulation help

Hello unix.com How can I add in B file TEST as many lines as A file has. Example: test1.txt has 2320 lines ... how can I add the word TEST 2320 lines in test2.txt. its something like: cat test1.txt;while read x; .... (4 Replies)
Discussion started by: galford
4 Replies

7. Shell Programming and Scripting

Text manipulation help

Hello Unix.com, How can i generate links like this: i got http://upload.com/1/1.txt and i need to generate links from http://upload.com/1/1.txt to http://upload.com/1000/1000.txt Thanks in advance, Galford D. Weller (4 Replies)
Discussion started by: galford
4 Replies

8. UNIX for Dummies Questions & Answers

Text manipulation

i want to generate a list line-by-line of normal characters using letters . for example : dnds gnos mgod pets jnfp etc... i want to use all letters with all the posibilities is there a script that can do this ? (3 Replies)
Discussion started by: suppliernr1
3 Replies

9. Shell Programming and Scripting

Text manipulation help

Hello again, I have a problem manipulating a large text document and there is no way I could edit this document by hand. Format is: Address : XXXX N 37 Ave, Hollywood, FL, 33021 Phone: XXX3190XXX Player: XXXXXX Character: Jaramillo DOB: June-14-1995 ----- Name: Alexandra Ticket... (3 Replies)
Discussion started by: galford
3 Replies

10. Shell Programming and Scripting

Help text manipulation

Hello Forum , I need a help about text manupulation. I have a text file and I have to manipulate this file. Let's say source.txt source.txt UNB+UNOC:3+O0013000005MAN MN RVS:91+0098006688:92+190304:2313+F004169241' UNH+8146848+DELJIT:D:96A:UN' BGM+307:::JIS_SYNCRO_FIRM+2019030423234101+9'... (8 Replies)
Discussion started by: cemokam65
8 Replies
jim_convert(1)						      General Commands Manual						    jim_convert(1)

NAME
jim_convert, jdic2txt, jsy2vjetxt, jsy2wxtxt, txt2jdic, vje2jsytxt, wx2jsytxt - Convert Japanese text and dictionary files between the JSY, WX, and VJE input methods SYNOPSIS
/usr/i18n/bin/jdic2txt [-v] [jsy-dictionary-filename] /usr/i18n/bin/jsy2vjetxt [jsy-text-filename] [vje-text-filename] /usr/i18n/bin/jsy2wxtxt [jsy-text-filename] [wx-text-filename] /usr/i18n/bin/txt2jdic [[-a] jsy-dictionary-filename] /usr/i18n/bin/vje2jsytxt [vje-text-filename] [jsy-text-filename] /usr/i18n/bin/wx2jsytxt [wx-text-filename] [jsy-text-filename] OPTIONS
Prints conversion statistics to stderr. Appends conversion results to an existing dictionary rather than creating a new dictionary. OPERANDS
Specifies the name of a JSY dictionary file. Specifies the name of a text file in JSY format. Specifies the name of the text file in VJE format. Specifies the name of a text file in WX format. DESCRIPTION
Three Japanese input methods are used on a Tru64 UNIX system: the JSY input method (Compaq), the WX input method (A.I. Soft Company), and the VJE input method (VACS Company). Software for the JSY input method is available in optional Tru64 UNIX subsets for Japanese language support. Software for the other two Japanese input methods is included only with the Japanese Tru64 UNIX product that is sold in Japan. Each of these input methods uses a specialized dictionary for conversion between Kana and Kanji characters. This fact makes it difficult for users to migrate their personal dictionaries from one input method to another, or to create a customized dictionary from a text source file for an existing dictionary. The converters described on this reference page help support customization and migration of private user dictionaries for Kana-Kanji conversion. The converters described on this reference page can be used in combination with utilities supplied with third-party software to migrate Kana-Kanji dictionaries from one input method to another. For the jsy2vjetxt, jsy2wxtxt, vje2jsytxt, and wx2jsytxt converters, both file operands are optional. If neither file is specified, stdin and stdout are used as input and output. If only one file is specified, that file is used as input and stdout is used as output. For the jdic2txt converter, stdin is used as input if the dictionary operand is omitted. The conversion results are always sent to stdout. For the txt2jdic converter, stdin is used as input. If the dictionary file argument is omitted, results are sent to stdout. The following diagrams show how the process for text file and dictionary conversion differs, depending on the input method format. In these diagrams, wx3ent and wx31st are utilities packaged with the WX input method software, and vuty is a utility packaged with the VJE input method software. The following diagrams show the process for converting dictionaries to text files using the same input method format: Text file in JSY format -> txt2jdic -> JSY dictionary JSY dictionary -> jdic2txt -> Text file in JSY format Text file in WX format -> wx3ent -> WX dictionary WX dictionary -> wx31st -> Text file in WX format Text file in VJE format -> vuty -> VJE dictionary VJE dictionary -> vuty -> Text file in VJE format The following diagrams show the process for converting text files from one input method format to another: Text file in JSY format -> jsy2wxtxt -> Text file in WX format Text file in JSY format -> jsy2vjetxt -> Text file in VJE format Text file in WX format -> wx2jsytxt -> Text file in JSY format Text file in VJE format -> vje2jsytxt -> Text file in JSY format The following diagrams show the process for converting dictionaries from one input method to another: JSY dict. -> jdic2txt -> jsy2wxtxt -> wx3ent -> WX dict. JSY dict. -> jdic2txt -> jsy2vjetxt -> vuty -> VJE dict. WX dict. -> wx31st -> wx2jsytxt -> txt2jdic -> JSY dict. VJE dict. -> vuty -> vje2jsytxt -> txt2jdic -> JSY dict. FILES
Directory where converters reside. SEE ALSO
Japanese(5) jim_convert(1)
All times are GMT -4. The time now is 05:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy