how to replace specific character , if possible using sed
My script is extracting data from SQl session, however sometimes the result contains one or multiple space after/before any numerical value.
e,g .
How to remove these unwanted spaces..so that I can get the following result :
"123","134",1345","435"
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
I am trying to use sed to replace specific characters at a specific position in the file with a different value... can this be done?
Example:
File:
A0199999123
A0199999124
A0199999125
Need to replace 99999 in positions 3-7 with 88888.
Any help is appreciated. (5 Replies)
Hi All,
Was wondering how I can do the following....
I have a String as follows
"ACCTRL000005022RRWDKKEEDKDD...."
This string can be in a file called tail.out or in a Variable called $VAR2
Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Hi,
I got long list of reference file (column one is refer to the header in input file; column 2 is info of start position in input file; column 3 is info of end position in input file;) shown as below:
read_2 10 15
read_3 5 8
read_1 4 10
.
.
.
Input file (huge file with total... (6 Replies)
I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work.
Brief overview:
I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
This is a file that I have
test line 1 (55)
)
test line 2 (45)
)
I would like to change all the parens in position 1 of this file to a );
i only want to check position 1 in every line of the file. I have tried different varations of sed, but cannot seem to be able to limit it to... (1 Reply)
hello
i have file with 100k records and each one has certain value that starts at 28th column and certain value that starts at 88th column
e.g. 1st file
<25>1234567 ..... <88> 8573785485
i have aditional file with values which are related to value that starts at 88th column of the... (1 Reply)
Discussion started by: dell1520
1 Replies
9. Post Here to Contact Site Administrators and Moderators
In file, we have millions of records each of 1000 in length. And at specific position say 800 there is a space, we need to replace it with Character X if the ID in that row starts with 123.
So far i have used the below which is replacing space at that position to X but its not checking for... (3 Replies)
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Discussion started by: teokon90
10 Replies
LEARN ABOUT PHP
msgfmt_format_message
MSGFMT_FORMAT_MESSAGE(3) 1 MSGFMT_FORMAT_MESSAGE(3)MessageFormatter::formatMessage - Quick format message
Object oriented style
SYNOPSIS
publicstatic string MessageFormatter::formatMessage (string $locale, string $pattern, array $args)
DESCRIPTION
Procedural style
string msgfmt_format_message (string $locale, string $pattern, array $args)
Quick formatting function that formats the string without having to explicitly create the formatter object. Use this function when the
format operation is done only once and does not need and parameters or state to be kept.
PARAMETERS
o $locale
- The locale to use for formatting locale-dependent parts
o $pattern
- The pattern string to insert things into. The pattern uses an 'apostrophe-friendly' syntax; it is run through umsg_autoQuoteA-
postrophe before being interpreted.
o $args
- The array of values to insert into the format string
RETURN VALUES
The formatted pattern string or FALSE if an error occurred
EXAMPLES
Example #1
msgfmt_format_message(3) example
<?php
echo msgfmt_format_message("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree
", array(4560, 123, 4560/123));
echo msgfmt_format_message("de", "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum
", array(4560, 123, 4560/123));
?>
Example #2
OO example
<?php
echo MessageFormatter::formatMessage("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree
", array(4560, 123, 4560/123));
echo MessageFormatter::formatMessage("de", "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum
", array(4560, 123, 4560/123));
?>
The above example will output:
4,560 monkeys on 123 trees make 37.073 monkeys per tree
4.560 Affen auf 123 Baumen sind 37,073 Affen pro Baum
SEE ALSO msgfmt_create(3), msgfmt_parse(3), msgfmt_get_error_code(3), msgfmt_get_error_message(3).
PHP Documentation Group MSGFMT_FORMAT_MESSAGE(3)