Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT
+SRR057408.1 FW8Y5CK02R652T length=34
FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Hi,
I wrote a small program to read lines from a file and count the lines. The program is as below:
filename=$1
count=0
cat $filename | while read -r line
do
printf "%5d:%s\n" $count "$line"
count=$((count + 1))
done
echo " $count "
After I run the program, the result is... (4 Replies)
Hi friends,
I am looking for sed command/script that would search for a given fixed pattern on odd lines and then if it matches, prints the matching pattern and the next line. For example, in the example below, i am looking for pattern 0 and 1011 on odd lines.
########## start of example file... (10 Replies)
Hello people,
I am trying with sed to insert some text at the beginning of each odd line of a file but no luck. Can you please help. Awk is also suitable but I am not very familiar with it.
Thank you in advance for any help. (7 Replies)
value=$(some command)
for all in `echo $value`
do
awk checks each value (all) to see if it is a odd number. if so, prints the value
done
sounds easy enough but i've been unable to find anything on google. (2 Replies)
Hello,
I'm here again asking for your precious help.
I'm writing some code to convert csv files to html.
I want to highlight header and also I want to have rows with alternate colors.
So far this is my work###Let's format first line only with some color
cat $fileIN".tmp1" | sed '1... (7 Replies)
Hello experts,
I wish to print the contents of odd-even numbered indices of an array.
The problem statement is as follows :
1. The first line contains an integer, (the number of test cases).
2. Each line of the subsequent lines containing a string.
Example:
2
Haider
Bash
... (4 Replies)
In the below directory I am trying to delete all lines with a .bam extention that have the pattern IonCode_ followed by an even number. I am also trying to delete all lines with a .fastq extention that have the pattern IonCode_ followed by an odd number. I was going to use find but can see all... (6 Replies)
In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT PHP
numfmt_parse_currency
NUMFMT_PARSE_CURRENCY(3) 1 NUMFMT_PARSE_CURRENCY(3)NumberFormatter::parseCurrency - Parse a currency number
Object oriented style
SYNOPSIS
public float NumberFormatter::parseCurrency (string $value, string &$currency, [int &$position])
DESCRIPTION
Procedural style
float numfmt_parse_currency (NumberFormatter $fmt, string $value, string &$currency, [int &$position])
Parse a string into a double and a currency using the current formatter.
PARAMETERS
o $fmt
-NumberFormatter object.
o $currency
- Parameter to receive the currency name (3-letter ISO 4217 currency code).
o $position
- Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended.
RETURN VALUES
The parsed numeric value or FALSE on error.
EXAMPLES
Example #1
numfmt_parse_currency(3) example
<?php
$fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY );
$num = "1.234.567,89xc2xa0$";
echo "We have ".numfmt_parse_currency($fmt, $num, $curr)." in $curr
";
?>
Example #2
OO example
<?php
$fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY );
$num = "1.234.567,89xc2xa0$";
echo "We have ".$fmt->parseCurrency($num, $curr)." in $curr
";
?>
The above example will output:
We have 1234567.89 in USD
SEE ALSO numfmt_get_error_code(3), numfmt_parse(3), numfmt_format_currency(3).
PHP Documentation Group NUMFMT_PARSE_CURRENCY(3)