Sponsored Content
Top Forums Shell Programming and Scripting How join line and add | in front Post 302369937 by bittoo on Tuesday 10th of November 2009 03:09:35 AM
Old 11-10-2009
if it is not perl, then use this.

cat abc.txt
timestamp=2009-11-10-04.55.20.829347;
a;
b;
c;
ddaa;

timestamp=2009-11-10-04.55.20.829347;
aa;
bb;
cc;

$cat abc.txt|awk '{if ( $0 ~ /time/ ) print "|"$0; else print $0}'|tr -d '\n'
|timestamp=2009-11-10-04.55.20.829347;a;b;c;ddaa;|timestamp=2009-11-10-04.55.20.829347;aa;bb;cc;
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

adding a character in front of a line

Hi everyon, I am trying to search for a pattern in a file and add "//" to the begining of the file. lets say i want to comment out a line from my codes. the line that should be commented out contains the word "reset". i need to search for the word "reset" and comment out that specific line. is... (5 Replies)
Discussion started by: ROOZ
5 Replies

2. Shell Programming and Scripting

ksh - adding a dynamic value to the front of a line

Hi Forum, Im trying to write some code to read a file, take a certain dynamic value and write it back to the file at the front of every line. For example, file.txt is: SIMPLE=HELLO CONFIDENTIAL=false SENDER=false REQUIRED=true FEEDBACK=false UPDATE=false REQUIRED=false MAPPING=true... (9 Replies)
Discussion started by: ocelot
9 Replies

3. Shell Programming and Scripting

Want to add a word in front a of each line of a file

Hi, Can anybody help me how to add a word in front of a line in a file.Actually it is bit tricky to add a word. i will give a sample for this: Input : 1110001 ABC DEF 1110001 EFG HIJ 1110001 KLM NOP 1110002 QRS RST 1110002 UVW XYZ Output: %HD% 1110001 ABC DEF %DT% 1110001 EFG HIJ... (4 Replies)
Discussion started by: apjneeraj
4 Replies

4. Shell Programming and Scripting

how to add single digit in front of the word and line in the file.

Hi , how to add the single digit to front of the word and front of the lines in the one file with compare pattern file and get digit. like example pattern file pattern.txt pattern num bala 2 raja 3 muthu 4 File Name: chennai.dat muthu is good boy raja is bad boy selvam in super... (6 Replies)
Discussion started by: krbala1985
6 Replies

5. Shell Programming and Scripting

Script for adding a word in front of all line in a file

Hi I've one file full of paths of certain files and I want to add some extra file words in front of all the paths. for eg: i have a file name test.txt which show some details only.. 024_hd/044/0344eng.txt 035_bv/222/editor.jpg here I want to add /usr/people/indiana/ infront of all the... (4 Replies)
Discussion started by: ratheeshp
4 Replies

6. UNIX for Dummies Questions & Answers

Stripping double quotes from front and end of a line

I have a file and some records may contain double quotes at beginning and at end of line. So how do I strip them? For Example, file is somethings like this Field1;Field2;Field3 01;'Test';'Test Field3' "01;'This is 2nd field';This is 3rd field' " Desired Output is: ... (6 Replies)
Discussion started by: vx04
6 Replies

7. Linux

How to add \ in front of $ in a script with vi?

Please help to provide command in vi to add \ in front of $ so it does not interpret next character. rm interfaces/DART/WEB-INF/classes/DART/util/TotalDisconnectUtil$1.class rm interfaces/DART/WEB-INF/classes/DART/util/TotalDisconnectUtil$2.class rm... (3 Replies)
Discussion started by: ywu081006
3 Replies

8. Shell Programming and Scripting

Add text in front of variable

I am just trying to add specific text in front of a ${variant} but can not seem to get the syntax correct. I have tried sed -i '$a NM_004004.5' ${variant} and printf "NM_004004.5:%s\n" ${variant} with no luck. Thank you :). (7 Replies)
Discussion started by: cmccabe
7 Replies

9. Shell Programming and Scripting

Insert a single quote in front of a line in vi editor

Hello Gurus, I wanted to put a single quote in every where starting with /oradata, and at the end with .dbf. For example I have one line as below: alter database rename datafile /oradata/test.dbf to /oradata_new/test.dbf I wanted as below alter database rename datafile '/oradata/test.dbf' to... (3 Replies)
Discussion started by: pokhraj_d
3 Replies

10. UNIX for Beginners Questions & Answers

How to add space in front of cat values?

Hi, Hope you are all doing fine. The problem today i faced during my coding was i wanted to add a space equals to a tab character in front of all the lines which i am cat using tee command. Main file contents mainfile ... (4 Replies)
Discussion started by: mad man
4 Replies
RTCANRECV(1)							      Xenomai							      RTCANRECV(1)

NAME
rtcanrecv - Xenomai tool for receiving CAN messages SYNOPSIS
rtcanrecv [<can-interface>] [Options] DESCRIPTION
rtcanrecv is part of Xenomai. It is used to receive messages via a CAN interface. The system must run a suitable Xenomai enabled kernel with the respective module (xeno_native and the CAN driver). OPTIONS
<can-interface> is the CAN interface file. rtcanrecv accepts the following options: -f, --filter=id:mask[:id:mask]... apply filter -e, --error=mask receive error messages -t, --timeout=MS timeout in ms -T, --timestamp with absolute timestamp -R, --timestamp-rel with relative timestamp -v, --verbose be verbose -p, --print=MODULO print every MODULO message -h, --help this help SEE ALSO
rtcanconfig(1), rtcanrecv(1) AUTHORS
rtcanrecv was written by Wolfgang Grandegger <wg@grandegger.com>, Jan Kiszka <jan.kiszka@web.de> and Philippe Gerum <rpm@xenomai.org>. This man page was written by Roland Stigge <stigge@antcom.de>. 2.6.0 2008-04-19 RTCANRECV(1)
All times are GMT -4. The time now is 03:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy