Finding files with the name of the results of another search


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Finding files with the name of the results of another search
# 8  
Old 10-03-2014
Quote:
Originally Posted by davidfreed
Thank you so much, but it doesnt work.
To test, I inserted the filename of one of the files in another file and tested as below:

Code:
#!/bin/ksh
while IFS=";" read junk x junk
do ls -1 *$x*.csv 2> /dev/null
done < cascs-233250026925740032.csv

there is no output.

now in cascs-233250026925740032.csv , we have one line with the filename of another file in this dir.
In your earlier posts, you said you had a CSV file named cascs-233250026925740032.csv that contained data in the format shown in the 1st message in this thread. Why (instead of putting your data in that file as you showed us) did you decide to put the name of a file in that file? Put the data in the file instead of the name of a file and try it again!
This User Gave Thanks to Don Cragun For This Post:
# 9  
Old 10-03-2014
Thank you so much, sorry I should be more precise, I actually meant data, or number.
for example I created casc-43564.csv file and put the record,
1;43564;1 in the file cascs-233250026925740032.csv but however it doesnt work-
# 10  
Old 10-03-2014
Please show us the output from the commands:
Code:
ls *43564* | od -bc

and
Code:
od -bc cascs-233250026925740032.csv

This User Gave Thanks to Don Cragun For This Post:
# 11  
Old 10-03-2014
Thank you so much, sorry yes you are right, it was my mistake.it works.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. What is on Your Mind?

Search Results (Search, New, and Today's Topics) Animation Switch

Hey, I added an animation switch on the search results page; so by default the thread previews are off, but if you want to look at them, just click on the green button and the thread previews will turn on (and back off). See image and attached animation: ... (1 Reply)
Discussion started by: Neo
1 Replies

2. Shell Programming and Scripting

Finding files with wc -l results = 1 then moving the files to another folder

Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those... (5 Replies)
Discussion started by: Dj Moi
5 Replies

3. Shell Programming and Scripting

Can ctag and cscope support recording search results and displaying the history results ?

Hello , When using vim, can ctag and cscope support recording search results and displaying the history results ? Once I jump to one tag, I can use :tnext to jump to next tag, but how can I display the preview search result? (0 Replies)
Discussion started by: 915086731
0 Replies

4. Shell Programming and Scripting

Search for Files and clear line after results

Hi, this is a little strange, i have the following code: if then echo -e "psa/admin/sbin present " which shows if a directory is present, but what I would like it to do is show the line and then remove its self and show the rest of the script... no idea what to look... (1 Reply)
Discussion started by: foz
1 Replies

5. Shell Programming and Scripting

AWK - no search results

Hi all, I'm new to awk and I'm experiencing syntax error that I don't know how to resolve. Hopefully some experts in this forum can help me out. I created an awk file that look like this: $ cat myawk.awk BEGIN { VAR1=PATTERN1 VAR2=PATTERN2 } /VAR1/ { flag=1 } /VAR2/ { flag=0 } {... (7 Replies)
Discussion started by: hk18
7 Replies

6. Shell Programming and Scripting

Operations on search results

Hi, I am a newbie at Unix scritping, and I have a question. Looking at the search functionality on Unix. Here I have a structure root---------dir1 ------- file1, file2, file3 |_____dir2 ______file1@, file4 |_____dir3_______file1@, file5 Under root directory, I... (4 Replies)
Discussion started by: nj302
4 Replies
Login or Register to Ask a Question