Search and store value from .csv


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Search and store value from .csv
# 1  
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.
# 2  
Old 02-15-2013
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

Proceed here:

https://www.unix.com/shell-programmin...-grep-awk.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question