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
Tk_GetJoinStyle(3)					       Tk Library Procedures						Tk_GetJoinStyle(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tk_GetJoinStyle, Tk_NameOfJoinStyle - translate between strings and join styles SYNOPSIS
#include <tk.h> int Tk_GetJoinStyle(interp, string, joinPtr) const char * Tk_NameOfJoinStyle(join) ARGUMENTS
Tcl_Interp *interp (in) Interpreter to use for error reporting. const char *string (in) String containing name of join style: one of "bevel", "miter", or "round". int *joinPtr (out) Pointer to location in which to store X join style corresponding to string. int join (in) Join style: one of JoinBevel, JoinMiter, JoinRound. _________________________________________________________________ DESCRIPTION
Tk_GetJoinStyle places in *joinPtr the X join style corresponding to string, which will be one of JoinBevel, JoinMiter, or JoinRound. Join styles are typically used in X graphics contexts to indicate how adjacent line segments should be joined together. See the X documentation for information on what each style implies. Under normal circumstances the return value is TCL_OK and interp is unused. If string does not contain a valid join style or an abbrevia- tion of one of these names, then an error message is stored in interp->result, TCL_ERROR is returned, and *joinPtr is unmodified. Tk_NameOfJoinStyle is the logical inverse of Tk_GetJoinStyle. Given a join style such as JoinBevel it returns a statically-allocated string corresponding to join. If join is not a legal join style, then "unknown join style" is returned. KEYWORDS
bevel, join style, miter, round Tk Tk_GetJoinStyle(3)
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy