10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I want to extract part of filename, for eg:
File="010020004_S-TOR-Sort-CASAP_20170519_121504_0007.TXT"
here i need first 5 words of file i.e.
FilePart="$(echo "${File%"${File#******}"}")"
Echo $FilePart
010020004_S-TOR-Sort-CASAP
But what if i get filename like below:
... (3 Replies)
Discussion started by: gnnsprapa
3 Replies
2. Shell Programming and Scripting
I want to extract the filename from a string.
This is how I have the rawdata ina file
/home/sid/ftp/testing/abc.txt
/home/sid/ftp/tested/testing/def.txt
/home/sid/sftp/date/misc/hij.txt
i want a script which would provide me an output like this
Directory ... (10 Replies)
Discussion started by: sidnow
10 Replies
3. Shell Programming and Scripting
Hello experts, I want to join a file with files whosE names are mentioned in one of the columns of the same file.
File 1
t1,a,b,file number 1
t1,a,c,file number 1
t2,c,d,file number 2
t2,c,e,file number 2
t2,c,f,file number 2
t2,c,g,file number 2
t3,e,f,file number 3
file number 1... (3 Replies)
Discussion started by: ritakadm
3 Replies
4. Shell Programming and Scripting
Hi
I need to extract the string from file name
filename: FILENAME_STRUT_01032013_XXXXXXX.TXT
I want 01032013 from the above file name. number of characters may differ before the required string but underscores(-) are same number i.e. after second underscore.
Please advise on this.
... (2 Replies)
Discussion started by: cnrj
2 Replies
5. Shell Programming and Scripting
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies
6. Shell Programming and Scripting
Hello,
Trying to iterate over set of file in current directory and check if the file name in that folder matches certain string. This is what I have so far. Here I am checking if the file name starts with nexus, if so echo file name to log file.
Getting weird syntax errors. Any help is... (7 Replies)
Discussion started by: scorpioraghu
7 Replies
7. Linux
Hi all,
I have a question..
Here is my requirement..I have 500 files in a path say /a/b/c
I have some numbers in a file which are comma seperated...and I wanted to check if the numbers are present in the FileName in the path /a/b/c..if the number is there in the file that is fine..but if... (1 Reply)
Discussion started by: us_pokiri
1 Replies
8. Shell Programming and Scripting
Hi, i have a filename CRED20102009.txt in a server
20102009 is the date of the file ddmmaaaa format
the complete route is
/dprod/informatica/Fuentes/CRED20102009.csv
i want to extract the date to create a new file named Parameters.txt
I need to create Parameters.txt with this... (6 Replies)
Discussion started by: angel1001
6 Replies
9. UNIX for Dummies Questions & Answers
I am trying to find a way to create a script which will extract the first line of a file and then rename the file (or create a new file with the same content as the old file) using the first line as the name. The first line being a single word, that is. I am hopeless at programming, if anyone can... (5 Replies)
Discussion started by: s.plumb
5 Replies
10. Shell Programming and Scripting
Hi All,
I posted something similar before but I now have a another problem.
I have filenames as below
TOP_TABIN240_20090323.200903231830
TOP_TABIN235_1_20090323.200903231830
i need to extract the dates as in bold. Using bash v 3.xx
Im trying to using the print sed command but... (11 Replies)
Discussion started by: santam
11 Replies