Sponsored Content
Top Forums Shell Programming and Scripting Splitting text string with "|" pipe delimiters Post 302426823 by alanp36 on Thursday 3rd of June 2010 04:37:03 AM
Old 06-03-2010
Thanks for the replies amitranjansahu, frans and Scrutinizer.

amitranjansahu, I saw yours first, and tried it. That works perfectly, thanks.

frans and Scrutinizer, thanks for the alternative methods. Very interesting - I will save those for possible future situations.

You guys are great Smilie. Cheers, Alan.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

input string="3MMTQSZ348GGMZRQWMJM4SD6M";output string="3MMTQ-SZ348-GGMZR-QWMJM-4SD6

input string="3MMTQSZ348GGMZRQWMJM4SD6M" output string="3MMTQ-SZ348-GGMZR-QWMJM-4SD6M" using linux shell script (4 Replies)
Discussion started by: pankajd
4 Replies

2. Shell Programming and Scripting

get string out of text file after "= "

I have a text file like: The name of the project = "Symbion centrifuge" The name of the subsytem = "motor demon" now i would like to read the string after the = into a variable to write it to another file. later use like: sed s/'PROJECTNAME'/"$projectname"/ <header.tex >temp ... (9 Replies)
Discussion started by: vivelafete
9 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

sort text having delimiter with "|" (pipe)

i am having text file below NARGU S S 12358 SALES REP |22| Acccount/s RAJU R B 64253 SALES REP |12| Acccount/s RUKMAN S 32588 SALES REP |10| Acccount/s NARGUND S S 12356... (3 Replies)
Discussion started by: suryanarayana
3 Replies

5. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

6. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

7. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

8. Shell Programming and Scripting

Need HELP with AWK split. Need to check for "special characters" in string before splitting the file

Hi Experts. I'm stuck with the below AWK code where i'm trying to move the records containing any special characters in the last field to a bad file. awk -F, '{if ($NF ~ /^|^/) print >"goodfile";else print >"badfile"}' filename sample data 1,abc,def,1234,A * 2,bed,dec,342,* A ... (6 Replies)
Discussion started by: shell_boy23
6 Replies

9. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

10. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
MORIA(6)							   Games Manual 							  MORIA(6)

NAME
moria - a dungeon game SYNOPSIS
moria [ -o ] [ -r ] [ -s ] [ -S ] [ -n ] [ -w ] [ savefile ] DESCRIPTION
Moria plays a dungeon game with you. It lets you generate a character, lets you buy equipment, and lets you wander in a fathomless dungeon while finding treasure and being attacked by monsters and fellow adventurers. Typing ? gives you a list of commands. The ultimate object of moria is to kill the Balrog, which dwells on the 50th level of the dungeon, 2,500 feet underground. Most players never even reach the Balrog, and those that do seldom live to tell about it. For a more complete description of the game, read the document The Dungeons of Moria. By default, moria will save and restore games from a file called moria.save in your home directory. If the environment variable MORIA_SAV is defined, then moria will use that file name instead of the default. If MORIA_SAV is not a complete path name, then the savefile will be created or restored from the current directory. You can also explicitly specify a savefile on the command line. If you use the -n option, moria will create a new game, ignoring any savefile which may already exist. This works best when a savefile name is specified on the command line, as this will prevent moria from trying to overwrite the default savefile (if it exists) when you try to save your game. You move in various directions by pressing the numeric keypad keys, VMS-style. If you specify -r, you move the same way you do in rogue(6). You can also specify -o to force the VMS-style command set. These options will override defaults stored in the savefile. If these options are given multiple times, only the last one will take effect. If you specify -s, moria prints all of the scores in the score file and exits. On a multiuser system, if you specify -S, moria prints prints only those scores belonging to you and then exits. If you specify -w, moria will start up in wizard mode. You can resurrect a dead character by using this option when starting the game. Resurrected characters are teleported to the town level and given zero hitpoints. Wizard mode is intended for debugging the game, and for experimenting with new features. Any other use is considered cheating. Games played with wizard mode are not scored. AUTHORS
The original version of Moria was written in VMS/Pascal by Robert Alan Koeneke, Jimmey Wayne Todd, Gary McAdoo, and others at the Univer- sity of Oklahoma. This version was written by Jim Wilson at the University of California, Berkeley, and released with minor revisions by David Grabiner at Harvard University. BUGS
A suspended game that gets a hangup signal will die without creating a save file. Rerolling with a % at the class prompt not implemented. For a more comprehensive list, see the ERRORS file in the source distribution. MORIA(6)
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy