Sponsored Content
Top Forums Shell Programming and Scripting append | to the end of each data in a file Post 302526256 by ankianand88 on Tuesday 31st of May 2011 04:20:09 AM
Old 05-31-2011
append | to the end of each data in a file

I have a file which has data in the below format:
Code:
7810902|6783014102| || |0| |0| |0| |0|||||T|04/13/2006||9423|7421||100|2006-04-13 16:50:28|||2006-04-13 16:50:28|n|51|-1||214
1089929|||||NewSpCreateAction request successful. Activity ID = <826528>||||100|n|2006-04-13 16:50:27|2006-04-13 16:50:28|C||
|826528||||
7810912|6783014112| || |0| |0| |0| |0|||||T|04/13/2006||9423|7421||100|2006-04-13 16:50:28|||2006-04-13 16:50:28|n|51|-1||214
1089929|||||NewSpCreateAction request successful. Activity ID = <826538>||||100|n|2006-04-13 16:50:27|2006-04-13 16:50:28|C||
|826538||||
7810922|6783014122| || |0| |0| |0| |0|||||T|04/13/2006||9423|7421||100|2006-04-13 16:50:28|||2006-04-13 16:50:28|n|51|-1||214
1089929|||||NewSpCreateAction request successful. Activity ID = <826548>||||100|n|2006-04-13 16:50:28|2006-04-13 16:50:28|C||
|826548||||

Now i want to add a | to the end of each data ...i.e. at the end of
Code:
7810922|6783014122| || |0| |0| |0| |0|||||T|04/13/2006||9423|7421||100|2006-04-13 16:50:28|||2006-04-13 16:50:28|n|51|-1||214
1089929|||||NewSpCreateAction request successful. Activity ID = <826548>||||100|n|2006-04-13 16:50:28|2006-04-13 16:50:28|C||
|826548||||

i.e. make 4 pipes to 5.
Please help

Last edited by Franklin52; 05-31-2011 at 05:26 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

echo, append to end of file

I need the line printed with echo to append to eof of to exactly line, am i able to do that? i mean echo "sysctl -w lalala=1" > to end of file /etc/sysctl.conf or to the 21st line, if the line exist, open new line and insert text there. Thx.maybe i'm in wrong topic but anyway... (2 Replies)
Discussion started by: hachik
2 Replies

2. Shell Programming and Scripting

to append few chars at the end of a file

hi i want to open a file at runtime append few chars at the end of each line all these i want to have done automatically how to do it (2 Replies)
Discussion started by: trichyselva
2 Replies

3. Shell Programming and Scripting

Append text at end of the first line in a file

Hi I need to append some text @ end of the first line in a file. like myfile.txt list = a,b,c list.a=some.. I give the arg "d" . now it append at end of first line list=a,b,c,d list.a=some... Please help me out this (7 Replies)
Discussion started by: catgovind
7 Replies

4. Shell Programming and Scripting

Append newline at the file end

Hi All, Is there any way to append a newline character at the end of a file(coma-separated file), through shell script? I need to check whether newline character exists at the end of a file, if it does not then append it. Regards, Krishna (1 Reply)
Discussion started by: KrishnaSaran
1 Replies

5. Shell Programming and Scripting

append a character at end of each line of a file

Hi, i want to append a character '|' at end of each line of a file abc.txt. for example if the file abc.txt conatins: a|b|c 1|2|33 w|2|11 i want result file xyz.txt a|b|c| 1|2|33| w|2|11| I know this is simple but sumhow i am not able to reach end of line. its urgent, thanks for... (4 Replies)
Discussion started by: muaz
4 Replies

6. Shell Programming and Scripting

append a record at the end of a file

Hi all, i have to append a record at the end of the file(a file which is already with some records).how do i do?please help me? is there any way of doing this with "SED" command.i am not sure.plz help me on this. would appreciate your ideas!!!! bye rao. (3 Replies)
Discussion started by: raoscb
3 Replies

7. Shell Programming and Scripting

How can I append a string at the end of a line in a file

Hi, guys. I have one question: I have a file called "group", the contents of it is below: ******************************** ... test:x:203: sales:x:204: repair:x:205: research:x:206:brownj ... *********** Now I want to add string ",sherrys" at the end of "research:x:206:brownj", so... (5 Replies)
Discussion started by: daikeyang
5 Replies

8. Shell Programming and Scripting

Append the end of each line in a file with a given string

Hi friends, I have a file containing many lines as follows. M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a M:\mmarimut_v6.4.0_pit_01\ADBasicView.java@@\main\v6.4.0_pit_a I would like to append the string "\0" at the end of each line in the file. The output should look... (10 Replies)
Discussion started by: nmattam
10 Replies

9. Shell Programming and Scripting

How to append word count at end of file?

Hi guys, I have to append the word count of a file at the end of the file name like this - > "filename_2345" where 2345 is the word count of "filename". How do i achieve this using one command ? I am not allowed to store the word count in a variable and then concatenate. Request your... (1 Reply)
Discussion started by: peter2312
1 Replies

10. Shell Programming and Scripting

To append new data at the end of each line based on substring of last column

Hi guys, I need to append new data at the end of each line of the files. This new data is based on substring (3rd fields) of last column. Input file xxx.csv: U1234|1-5X|orange|1-5X|Act|1-5X|0.1 /sac/orange 12345 0 U5678|1-7X|grape|1-7X|Act|1-7X|0.1 /sac/grape 5678 0... (5 Replies)
Discussion started by: null7
5 Replies
Encode::Arabic::ArabTeX::RE(3pm)			User Contributed Perl Documentation			  Encode::Arabic::ArabTeX::RE(3pm)

NAME
Encode::Arabic::ArabTeX::RE - Deprecated Encode::Arabic::ArabTeX implemented with regular expressions REVISION
$Revision: 162 $ $Date: 2006-12-16 01:16:10 +0100 (Sat, 16 Dec 2006) $ SYNOPSIS
use Encode::Arabic::ArabTeX::RE; $string = decode 'arabtex-re', $octets; $octets = encode 'arabtex-re', $string; DESCRIPTION
Deprecated method using sequential regular-expression substitutions. Limited in scope over the ArabTeX notation and non-efficient in data processing, still, not requiring the Encode::Mapper module. EXPORTS & MODES Exports as if "use Encode" also appeared in the package. Experimental and incomplete support for conversion modes is provided, see Encode::Arabic::ArabTeX. SEE ALSO
Encode::Arabic::ArabTeX AUTHOR
Otakar Smrz, <http://ufal.mff.cuni.cz/~smrz/> eval { 'E<lt>' . ( join '.', qw 'otakar smrz' ) . "x40" . ( join '.', qw 'mff cuni cz' ) . 'E<gt>' } Perl is also designed to make the easy jobs not that easy ;) COPYRIGHT AND LICENSE
Copyright 2003-2006 by Otakar Smrz This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-01-18 Encode::Arabic::ArabTeX::RE(3pm)
All times are GMT -4. The time now is 10:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy