Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Inserting the last field first Post 302942071 by RavinderSingh13 on Friday 24th of April 2015 03:45:40 AM
Old 04-24-2015
Hello Kristinu,

Not sure if I understood your reuirement completly but following may help you. Let me know if you have any queries on same. Please always show us the expected output of yours which will help us to understand the requirement clearly.
Code:
awk '{A=$0;gsub(/.*_|\..*/,X,$0);print $0 OFS A;}' Input_file

Output will be as follows.
Code:
2007 roman_pottery_in_the_archaeological_record_2007.pdf
2007 power_politics_and_religion_in_timurid_iran_2007.pdf
2006 toward_a_theory_of_human_rights_religion_law_courts_2006.pdf
2008 i_was_wrong_the_meanings_of_apologies_2008.pdf

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Question about sed. Inserting text in field?

Hi, I have tried to develop a sed script that inserts date and time in the third field in the first and second row below. The third row is an example and it shows where the date and time should be inserted. The script should check if the row already has date and time in the third field and if it... (2 Replies)
Discussion started by: pcrs
2 Replies

2. Shell Programming and Scripting

Sort alpha on 1st field, numerical on 2nd field (sci notation)

I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this: abc ||| 5e-05 ||| bla abc ||| 3 ||| ble def ||| 1 ||| abc def ||| 0.2 ||| def As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
Discussion started by: FrancoisCN
1 Replies

3. Shell Programming and Scripting

gawk help for inserting a field of a .txt file in the same file

i had the following type of data file vchrdump: Vouchers For Date :05/01/2009 * ... (4 Replies)
Discussion started by: KANNI786
4 Replies

4. Shell Programming and Scripting

ORA-01756 Error while inserting a file in CLOB field

Hi, Please guide me where i am doing wrong, i am getting ORA-01756:quoted string not properly terminated when i am trying to insert file into CLOB cloumn of Oracle DB. Please find below the code where log file variable is myLogFile. Please let me know where i am doing wrong. ... (0 Replies)
Discussion started by: rajeshorpu
0 Replies

5. UNIX for Dummies Questions & Answers

Best method for inserting a field from a file into another file?

Hello, Hoping someone can help! I have a file (fileA) with a potentially different number of | delimited fields the file looks like: fileA A|B|C|D|E|F|G| A|B|C|D|E|F|G| This file could have 100+ fields and have 2million+ records I have another file (fileB) which contains an 8 digit... (3 Replies)
Discussion started by: dendright
3 Replies

6. Shell Programming and Scripting

Inserting a new field inbetween two exisitng field

I have a '|' delimited file. My file looks like below 23|nationalhoilday|feb12||||||||||||||california|northdistrict|| In the same way, each record has 164 fields. I have to insert one more field after the 85th field. Expected output... (3 Replies)
Discussion started by: machomaddy
3 Replies

7. Shell Programming and Scripting

Inserting string in between field in comma separated file

Hello Mates, I have one txt file having commo seperated values. I have to insert string "FALSE" in 2nd field from the end. E.G SE18 6RN,,,,5439070,1786840,,1000002148671600,123434 Out put should be: SE18 6RN,,,,5439070,1786840,FALSE,1000002148671600,123434 Can some one help me to... (8 Replies)
Discussion started by: krsnadasa
8 Replies

8. UNIX for Dummies Questions & Answers

Inserting a sequential number into a field on a flat file

I have a csv flatfile with a few million rows. I need to replace a field (field number is 85) in the file with a sequential number. As an example, let's assume there are only 4 fields in the file: A,A,,32 A,A,,27 A,B,,43 C,C,,354 If I wanted to amend the 3rd field in this way my... (2 Replies)
Discussion started by: BristolSmithy
2 Replies

9. Shell Programming and Scripting

Inserting some text if a field in the last column changes

Hi, I have a file which looks like this: A 01 00 B 02 00 C 04 00 D 00 01 E 01 01 F 02 01 G 01 04 H 02 04 I want to insert some text if the field if the last column changes. It should look like this: Value 00 A 01 00 B 02 00 C 04 00 Value 01 (6 Replies)
Discussion started by: wenclu
6 Replies

10. Shell Programming and Scripting

Inserting a field without disturbing field separator on other fields

Hi All, I have the input as below: cat input 032016002 2.891 97.109 16.605 27.172 24.017 32.207 0.233 0.021 39.810 0.077 0.026 19.644 13.882 0.131 11.646 0.102 11.449 76.265 23.735 16.991 83.009 8.840 91.160 0.020 99.980 52.102 47.898 44.004 55.996 39.963 18.625 0.121 1.126 40.189... (15 Replies)
Discussion started by: am24
15 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 08:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy