Sponsored Content
Top Forums Shell Programming and Scripting Search and store value from .csv Post 302770265 by yadavricky on Friday 15th of February 2013 04:13:43 AM
Old 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

Does anybody know how to store my tables to a csv file?

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

Hex value search in a csv

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

Store table contents in csv file

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

Execute stored procedure through script in sybase database and store the output in a .csv file

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

Search file for string and store last result to variable

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

to read two files, search for patterns and store the output in third file

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

Perl search csv fileA where two strings exist on another csv fileB

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

awk read column csv and search in other csv

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

Script to store the csv files into a particular folder

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

Read in search strings from text file, search for string in second text file and output to CSV

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
ZIP_OPEN(3)						     Library Functions Manual						       ZIP_OPEN(3)

NAME
zip_open - open zip archive LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> struct zip * zip_open(const char *path, int flags, int *errorp); DESCRIPTION
The zip archive specified by path is opened and a pointer to a struct zip, used to manipulate the archive, is returned. The are specified by or'ing the following values, or 0 for none of them. ZIP_CREATE Create the archive if it does not exist. ZIP_EXCL Error if archive already exists. ZIP_CHECKCONS Perform additional consistency checks on the archive, and error if they fail. If an error occurs and errorp is non-NULL, it will be set to the corresponding error code. RETURN VALUES
Upon successful completion zip_open returns a struct zip pointer. Otherwise, NULL is returned and *errorp is set to indicate the error. ERRORS
The archive specified by path is opened unless: [ZIP_ER_EXISTS] The file specified by path exists and ZIP_EXCL is set. [ZIP_ER_INCONS] Inconsistencies were found in the file specified by path and ZIP_CHECKCONS was specified. [ZIP_ER_INVAL] The path argument is NULL. [ZIP_ER_MEMORY] Required memory could not be allocated. [ZIP_ER_NOENT] The file specified by path does not exist and ZIP_CREATE is not set. [ZIP_ER_NOZIP] The file specified by path is not a zip archive. [ZIP_ER_OPEN] The file specified by path could not be opened. [ZIP_ER_READ] A read error occurred; see for details. [ZIP_ER_SEEK] The file specified by path does not allow seeks. SEE ALSO
libzip(3), zip_close(3), zip_error_to_str(3), zip_fdopen(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH February 15, 2009 ZIP_OPEN(3)
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy