10-14-2010
Replace several numbers with respective tag and make a single file
Dear All,
I have a final output files as
HTML Code:
736645|0|
13879|1|
495563|10|
127933|14|
4975|16|
49038|6|
53560|7|
135115|8|
178857|9|
Now I want to replace second column with respective tag as per the value
for e.g
0------- Success
1------- Failure
10------ unknown
.
.
.
.
.
and lastly make a single files that contains output as
HTML Code:
736645|Success|
13879|Failure|
495563|Unknown|
127933|etc.|
4975|etc|
49038|etc|
53560|etc|
135115|etc|
178857|etc|
I use sed command but it replace correclty but then I am unable to make it in a single files
command is as
cat a.txt | sed 's/|0|/|Succes|/g' > test.wri
Please help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
suppose u have a file
aas P-H 123
gdg O-U 223
hdy I-Y 12
fgd K-O 333
ssa L-P 32
output shud be like that
aas P123H
gdg O223U
hdy I12Y
fgd K333O
ssa L32P
thanks (7 Replies)
Discussion started by: cdfd123
7 Replies
2. AIX
How to replace many numbers with one number in a file.
Many numbers like 444565,454678,443298,etc. i want to replace these with one number (300).Please halp me out. (2 Replies)
Discussion started by: vpandey
2 Replies
3. Shell Programming and Scripting
Hi All ,
Want to know the "sum" of all the digits in below file called "/sample" .Could some one please let me know the script either command .
cat /sample
12
34
23
23
Best Regards,
Chinni . (5 Replies)
Discussion started by: chinni-script
5 Replies
4. Shell Programming and Scripting
Hi,
Can anyone help me to search for multiple strings within specified position and replace with respective string value.
For example I need to search the string from the position 11 to 20 and if it contain ABC and then replace it by BCDEFGHIJ ... find AABZSDJIK and replace with QWE. and... (4 Replies)
Discussion started by: zooby
4 Replies
5. Shell Programming and Scripting
Hey guys,
I need to know how to locate all .htaccess files on the server and make a backup of them in the folder they reside before I run a script to modify all of them.
So basically taking dir1/.htaccess and copying it as dir1/.htaccess_bk
dir2/.htaccess copying as dir2/.htaccess_bk... (5 Replies)
Discussion started by: boxx
5 Replies
6. Shell Programming and Scripting
How would I do this? How could i use <> symbols for numbers in the find/replace code below?
perl -pi -e 's/test/tst/'
OR is there a better way?
100 5000 2 432 4 2 33 4 5 6 65 300 301
needs to be:
100 300 2 300 4 2 33 4 5 6 65 300 300
also it might not always need spaces... i... (12 Replies)
Discussion started by: herot
12 Replies
7. Shell Programming and Scripting
Hi,
I have a file that consist of around six million line, now the task is to divide this file into 12 small file so that each file would have half a million lines in it.
Thanks. (3 Replies)
Discussion started by: mukulverma2408
3 Replies
8. Shell Programming and Scripting
I have the input file like this.
Input file: 12.txt
1) There are one or more than one <tr> tags in same line.
2) Some tr tags may have one <td> or more tna one <td> tags within it.
3) Few <td> tags having "<td> </td>". Few having more than one " " entry in it.
<tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies
9. Shell Programming and Scripting
Hello,
I am trying to make a awk code that will take 2 files, a txt file like this :
1 1 88 c(1:38, 42, 102)
2 2 128 c(39:41, 43:101, 103:105, 153, 155:189, 292, 344:369)
3 3 84 c(190:249, 603, 606:607, 609:629)
4 4 12 ... (8 Replies)
Discussion started by: nastaziales
8 Replies
10. UNIX for Beginners Questions & Answers
awk 'BEGIN{print "<table>"} {print "<tr>";
for ( i=1;i<NF;i++) print " <td>" $I "</td>";
print "</tr>"}
END{print " </table>"}' <file name > (6 Replies)
Discussion started by: Himanshu1
6 Replies
LEARN ABOUT REDHAT
vorbiscomment
VORBISCOMMENT(1) Vorbis Tools VORBISCOMMENT(1)
NAME
vorbiscomment - edits Ogg Vorbis comments
SYNOPSIS
vorbiscomment [-l] file.ogg
vorbiscomment -a [ -t "tag=value" ] in.ogg out.ogg
vorbiscomment -w in.ogg out.ogg
DESCRIPTION
vorbiscomment reads, modifies, and appends Ogg Vorbis audio file metadata tags.
OPTIONS
-a Append comments.
-c commentfile
Take comments from a file. The file is the same format as is output by the the -l option: one element per line in 'tag=value' for-
mat.
-h Show command help.
-l List the comments in the ogg vorbis file.
-q Quiet mode. No messages are displayed.
-t 'tag=value'
Specify a new tag on the command line. Each tag is given as a single string. The part before the '=' is treated as the tag name and
the part after as the value.
-w Replace comments with the new set given either on the command line with -t or from a file with -c.
EXAMPLES
To just see what comment tags are in a file:
vorbiscomment -l file.ogg
To edit those comments:
vorbiscomment -l file.ogg > file.txt
[edit the comments in file.txt to your statisfaction]
vorbiscomment -w -c file.txt file.ogg newfile.ogg
To simply add a comment:
vorbiscomment -a -t 'ARTIST=No One You Know' file.ogg newfile.ogg
SEE ALSO
See http://xiph.org/ogg/vorbis/doc/v-comment.html for documentation on the Ogg Vorbis tag format, including a suggested list of canonical
tag names.
AUTHORS
Program Authors:
Michael Smith <msmith@labyrinth.net.au>
Ralph Giles <giles@xiph.org>
Manpage Author:
Christopher L Cheney <ccheney@debian.org>
Xiph.org Foundation December 24, 2001 VORBISCOMMENT(1)