Sponsored Content
Top Forums Shell Programming and Scripting cut between characters of a file Post 302334785 by Tytalus on Thursday 16th of July 2009 12:13:19 PM
Old 07-16-2009
this should work:

Code:
#  ls pi*
pi-abcd567sd.pdf   pi-efgh1.pdf

#  for i in pi*; do mv $i $(echo $i|nawk -F"[-.]" '{print $1"-"toupper($2)"."$3}');done

#  ls
pi-ABCD567SD.pdf   pi-EFGH1.pdf

HTH
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to cut first 3 characters of each line in a file

Hi Friends I have a file like sample1.txt ------------ 10998909.txt 10898990.txt 1898772222.txt 8980000000000.txt I need to take first 3 characters of each line in a file and i need to print it ' like loop 109 108 189 898 (7 Replies)
Discussion started by: kittusri9
7 Replies

2. Shell Programming and Scripting

cut 1st 2 characters off all line1st in file

I know this sounds simple, but I have a logfile with > something > something_else > another_entry ... how do I cut the first 2 characters off the left side? I tried to use cut -c 1-2 somefile > someotherfile but that just cut gave me the 2 left characters, I want to cut those out... (2 Replies)
Discussion started by: unclecameron
2 Replies

3. Shell Programming and Scripting

Need to cut first 21 and 32-25 characters from file

Guys, can you help me in doing cut first 21 and 32-35 characters from file. I tried with cut -c to cut first 21 characters ,It is succeeded. But i need both first 21 and 32-35. (1 Reply)
Discussion started by: mohan_xunil
1 Replies

4. AIX

How to cut a flat file according to a certain number of characters?

hello everybody i am looking for a shell to cut a flat file (with a long unique line) according to a certain number of characters and redirect every result to an output file. here is an example MyFile : 12 3 456 12 3 456 12 3 456 ..... and i took every 9-characters including BLANKS... (6 Replies)
Discussion started by: fastlane3000
6 Replies

5. Shell Programming and Scripting

Cut the last 15 characters off

Hi Gurus, I am trying to execute the below command. However the output shows the value + path of the folder where the command is being executed. But I am only interested in the value but not the path. du -hs /aps/inf/SeLogs when I execute the above command, output is 32G... (5 Replies)
Discussion started by: svajhala
5 Replies

6. Shell Programming and Scripting

Cut last 7 characters of a variable

I need to cut the last seven characters of a variable length variable. The variable may be 7 characters or 70. I need to always be able to grab the last 7 characters. I looked at the cut command but it always seems to want to start at the beginning of a line, not the end and count backwards. ... (5 Replies)
Discussion started by: kblawson14
5 Replies

7. Shell Programming and Scripting

Cut last 13 characters and take the rest of the file name

Hi, I would like to cut last 13 characters of a file name and take the rename the file name as follows: Input: A.DAT20110517033732 Output: A.DAT I have tried the following command and cut last 13 characters. echo A.DAT20110517033732 | awk '{print substr($0, length($0)-13)}' ... (3 Replies)
Discussion started by: pyaranoid
3 Replies

8. Shell Programming and Scripting

cut certain characters for each line in a file

Hi Everyone, i have a file 1.txt <a><a"" dd>aaaaauweopriuew</f><">!(^)!</aa></ff> <a><a"" dd>bbbbbuweopriuew</f><">!(^*)!</aa></ff> i know i can use perl -p -i -e "s/>aaaaa/aa/g" 1.txt perl -p -i -e "s/>bbbbb/bb/g" 1.txt to acheive only keep the first two characters of the five characters,... (4 Replies)
Discussion started by: jimmy_y
4 Replies

9. Shell Programming and Scripting

Cut a string for last 8 characters

Hello All I have a file like this abc.tpt.ctl bdc.tpt.ctl cdw.tpt.ctl I have looped every line using the for Loop, now I want to take each line and cut the .tpt.ctl part of it and store it in a variable and use the variable in same loop. The part I am stuck at is how do I cut the last... (9 Replies)
Discussion started by: nnani
9 Replies

10. Shell Programming and Scripting

Cut the first 100 characters of file

Hello all, I have a file and would like to cut the first 100 characters of the first line. I tried it with the ‘cut’-command: cut –c100- $file > $file.tmp But this does not work, because it will cut the first 100 characters of each line. But I need to cut them only from the beginning of... (6 Replies)
Discussion started by: API
6 Replies
HTTP_SEND_FILE(3)							 1							 HTTP_SEND_FILE(3)

http_send_file - Send file

SYNOPSIS
bool http_send_file (string $file) DESCRIPTION
Sends a file with support for (multiple) range requests. This functions behaviour and further action is dependent on the following INI settings: http.send.not_found_404 and http.log.not_found. If the INI settinghttp.send.not_found_404 is enabled and the INI settinghttp.log.not_found points to a writable file, a log message is written when the $file was not found. PARAMETERS
o $file - the file to send RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 A http_send_file(3) example <?php http_send_content_disposition("document.pdf", true); http_send_content_type("application/pdf"); http_throttle(0.1, 2048); http_send_file("../report.pdf"); ?> The above example will output: HTTP/1.1 206 Partial Content X-Powered-By: PHP/5.2.2 Accept-Ranges: bytes Content-Length: 12345 Content-Range: bytes 0-12344 Content-Type: application/pdf Content-Disposition: inline; filename="document.pdf" %PDF... SEE ALSO
http_send_data(3), http_send_stream(3), http_throttle(3), http_send_content_type(3), http_send_content_disposition(3), the HttpResponse class if you are using PHP 5.1.0 and above. PHP Documentation Group HTTP_SEND_FILE(3)
All times are GMT -4. The time now is 06:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy