02-15-2013
Search and store value from .csv
Dear All,
I am using the command to find the value from path
DYMV_STD_NAME=$( echo $file | sed 's#.*/[^_][^_]*_\([^_][^_]*\).*#\1#' )
file = RRK11234_RKY5807_SRY000_HOME_20071010.zip
It give me value DYMV_STD_NAME = RKY5807
Now i have flat as below
The contect of the file would be as below.
Home_TITLE,People_TITLE,Repo_ALIAS
HMN5530,RKY5807,/mine_repo/rike001
HMN5530,SRY6443,/mine_repo/rike001
HMN5530,ARDY001,/mine_repo/rike001
I want to store only respective value in variable For value RKY5807
in one one variable i want to store HMN5530 and in another variable /mine_repo/rike001
Please somebody can provide the code for this.
10 More Discussions You Might Find Interesting
1. UNIX and Linux Applications
Hi
I'm using an oracle database... Lets call it databasename
My username and password are the same .... lets all that andrea/andrea
So I want to write a script to copy all the data from my table called tablename and store that data to a csv file called filename.
I cant seem to get... (2 Replies)
Discussion started by: ladyAnne
2 Replies
2. UNIX for Dummies Questions & Answers
I have looked at other posts on this and cannot get what I need,
I have a csv file (UTF -8) that has corrupt data in:
"p.fażżżż","ażżża","","","",""
The hex value for the upside down ? is a C2BF
How can I search a csv file for this hex value C2BF
Any help would be appreciated
... (2 Replies)
Discussion started by: Pablo_beezo
2 Replies
3. Shell Programming and Scripting
I need to write a script to store the contents of a table in a csv file
I'm using Toad, it's a Oracle database. (5 Replies)
Discussion started by: ladyAnne
5 Replies
4. Shell Programming and Scripting
Hi,
I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output.
I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies
5. Shell Programming and Scripting
Hi,
I'm trying to search a text file for a string: "energy(sigma->0)=". To do so, I executed the grep command, which returned many matches, for example:
energy without entropy = -112.16486170 energy(sigma->0) = -112.16520778
energy without entropy = -112.16488936 ... (5 Replies)
Discussion started by: gwr
5 Replies
6. Shell Programming and Scripting
hello
i have two files
temp.txt
and temp_unique.text
the second file consists the unique fields from the temp.txt file
the strings stored are in the following form
4,4
17,12
15,65
4,4
14,41
15,65
65,89
1254,1298i'm able to run the following script to get the total count of a... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies
7. Shell Programming and Scripting
Hi
I have two csv files, with the following formats:
FileA.log:
Application, This occured blah
Application, That occured blah
Application, Also this
AnotherLog, Bob did this
AnotherLog, Dave did that
FileB.log:
Uk, London, Application, datetime, LaterDateTime, Today it had'nt... (8 Replies)
Discussion started by: PerlNewbRP
8 Replies
8. Shell Programming and Scripting
hi, someone to know how can i read a specific column of csv file and search the value in other csv columns if exist the value in the second csv copy entire row with all field in a new csv file. i suppose that its possible using awk but i m not expertise thanks in advance (8 Replies)
Discussion started by: giankan
8 Replies
9. Shell Programming and Scripting
I want to write a unix shellScript should store the csv files. into a paticular folder (2 Replies)
Discussion started by: RaghavendraT
2 Replies
10. Shell Programming and Scripting
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Discussion started by: An0mander
2 Replies
APC_ADD(3) 1 APC_ADD(3)
apc_add - Cache a new variable in the data store
SYNOPSIS
bool apc_add (string $key, mixed $var, [int $ttl])
DESCRIPTION
array apc_add (array $values, [mixed $unused = NULL], [int $ttl])
Caches a variable in the data store, only if it's not already stored.
Note
Unlike many other mechanisms in PHP, variables stored using apc_add(3) will persist between requests (until the value is removed
from the cache).
PARAMETERS
o $key
- Store the variable using this name. $keys are cache-unique, so attempting to use apc_add(3) to store data with a key that
already exists will not overwrite the existing data, and will instead return FALSE. (This is the only difference between
apc_add(3) and apc_store(3).)
o $var
- The variable to store
o $ttl
- Time To Live; store $var in the cache for $ttl seconds. After the $ttl has passed, the stored variable will be expunged from the
cache (on the next request). If no $ttl is supplied (or if the $ttl is 0), the value will persist until it is removed from the
cache manually, or otherwise fails to exist in the cache (clear, restart, etc.).
o $values
- Names in key, variables in value.
RETURN VALUES
Returns TRUE if something has effectively been added into the cache, FALSE otherwise. Second syntax returns array with error keys.
EXAMPLES
Example #1
A apc_add(3) example
<?php
$bar = 'BAR';
apc_add('foo', $bar);
var_dump(apc_fetch('foo'));
echo "
";
$bar = 'NEVER GETS SET';
apc_add('foo', $bar);
var_dump(apc_fetch('foo'));
echo "
";
?>
The above example will output:
string(3) "BAR"
string(3) "BAR"
SEE ALSO
apc_store(3), apc_fetch(3), apc_delete(3).
PHP Documentation Group APC_ADD(3)