Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)
Lets say I have a file abc.txt and it has about 35 million rows. I would like to take a sample of 100 random rows from that file for my testing purpose and write it to a file say test.txt.
How do I do this operation?
Thanks,
Sashank (9 Replies)
Hi
I want to append line 2n to 2n-1 line where n=1...LastLine in my file.
eg:
Actual File:
Hello
Everyone
Welcome
TO Unix
I need
Your help
Required File:
HelloEveryone
WelcomeTO Unix
I needYour help (5 Replies)
hi guys, today i'm stuck in a new problem.
the title explain more or less but a particular had been omitted. So i'm going to describe below the situation with an example.
I have different html files and each of them have a consecutive lines group inside that i want to extract.
example:
... (8 Replies)
Hi Friends,
I have a single column data like below.
1
2
3
4
5
I need the output like below.
0
1
2
3
4
where each row (including first row) subtracting from first row and the result should print below like the way shown in output file.
Thanks
Sid (11 Replies)
I have a fixed length file and I want to find out row number along with row length.
I have a program that give me the line length if it satisfy the condition; but i would like to add row number as well?
How do I do that?
while IFS= read -r line; do
if ; then
echo ${line}
echo... (8 Replies)
Hi.
How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg
file1
1:abc
3:ghi
6:pqr
file2
a abc
b def
c ghi
d jkl
e mno
f pqr
... (6 Replies)
this is the requirement
list.txt
table1
table2
table3
testfile.txt
name#place#data#select * from table1
name2#place2#data2#select * from table 10 innerjoin table3
name2#place2#data2#select * from table 10
output
name place table1
name2 place table3
i tried using awk (7 Replies)
DBASE_GET_RECORD_WITH_NAMES(3) 1 DBASE_GET_RECORD_WITH_NAMES(3)dbase_get_record_with_names - Gets a record from a database as an associative arraySYNOPSIS
array dbase_get_record_with_names (int $dbase_identifier, int $record_number)
DESCRIPTION
Gets a record from a dBase database as an associative array.
PARAMETERS
o $dbase_identifier
- The database link identifier, returned by dbase_open(3) or dbase_create(3).
o $record_number
- The index of the record.
RETURN VALUES
An associative array with the record. This will also include a key named deleted which is set to 1 if the record has been marked for dele-
tion (see dbase_delete_record(3)).
Each field is converted to the appropriate PHP type, except:
o Dates are left as strings.
o Integers that would have caused an overflow (> 32 bits) are returned as strings.
On error, dbase_get_record_with_names(3) will return FALSE.
EXAMPLES
Example #1
Listing all the registered members in the database
<?php
// open in read-only mode
$db = dbase_open('/tmp/test.dbf', 0);
if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i <= $record_numbers; $i++) {
$row = dbase_get_record_with_names($db, $i);
if ($row['ismember'] == 1) {
echo "Member #$i: " . trim($row['name']) . "
";
}
}
}
?>
SEE ALSO dbase_get_record(3).
PHP Documentation Group DBASE_GET_RECORD_WITH_NAMES(3)