10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Seders,
i am new to this forum, but i think it's quite the best place to post.
So, here is my pb :
I have a csv file, with comma separator and text enclosed by ".
First pb is with text in " ......... ", wich sometimes includes lines break, and commas
And to complicate a little more,... (4 Replies)
Discussion started by: yogeek
4 Replies
2. Shell Programming and Scripting
Hi all,
I have a file like this
Q8N302
21-84
Q8N157
15-45
Q99996
167-201
202-251
269-318
I want to insert a character or space if the line starts with a number and I used the command
sed 's/^/#/'
But in the output file, when it inserts this character, first digit in the number is... (2 Replies)
Discussion started by: kaav06
2 Replies
3. Shell Programming and Scripting
sed 's/$/TEST/g' will insert TEST at the end of each line. i want to insert TEST at column 64 (7 Replies)
Discussion started by: lawsongeek
7 Replies
4. Shell Programming and Scripting
I have done this sed command to insert one line after a specific string is found:
sed '/patternstring/ a\
new line string' file1
But how do I insert two lines? This is not possible:
sed '/patternstring/ a\
new line string \a
new line string 2' file1 (2 Replies)
Discussion started by: locoroco
2 Replies
5. Shell Programming and Scripting
Hi All
I'm trying to insert a pattern if a pattern is found in a file.
This is my sample file
"PDA"|"Celvin"|"PRJ_NA"|"Completion_Units"|25
"PDA"|"Celvin"|"PRJ_AB"|"Completion_Units"|250
I would like to output as
"PDA"|"Celvin"|"PRJ_NA"|"Completion_Units"|"Done"|25... (3 Replies)
Discussion started by: Celvin VK
3 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I have the following data in a korn shell variable:
a="FirstValue|SecondValue|ThirdValue"
The value between "FirstValue", "SecondValue" and "ThirdValue" can change, in this case is a comma: "," and I need to print it only once. I need to know what is the separator value.
I... (3 Replies)
Discussion started by: felipe.vinturin
3 Replies
7. Shell Programming and Scripting
Hi there
I am trying to convert some date seperators in a large newline delimited file. each line i am interested in has a date in the format 27/05/2009 all I want is to convert the slashes to tildes(~) I have come up with the following code but it does nothing.
sed... (5 Replies)
Discussion started by: RadRod
5 Replies
8. Shell Programming and Scripting
Hi,
I'm using the following to insert lines into file:
sed ${rowNr}i'\
first row\
second row\
third row\
' file.txt
How can I add tab in front of each added line? "\t" or actual TAB does not seem to work?
Thanks! (2 Replies)
Discussion started by: Juha
2 Replies
9. UNIX for Dummies Questions & Answers
Hello. Trying to insert text at line 1 and after last line of file. I have searched posts but nothing seems to work. I keep getting extra characters error or nothing gets inserted into the file.
#!/bin/sh
touch textfile.txt
sed 'i\
Add this line before every line with WORD' textfile.txt
... (5 Replies)
Discussion started by: steveramsey
5 Replies
10. Shell Programming and Scripting
how can i modify a file using sed when searching
for a pattern and insert newline after the pattern?
pattern example: $ ...(any characters)...$
$ may082001.../tmp/msg.001,,$ REPT CLEAR ALARMS ON UNIT 1
$ may082001.../tmp/msg.002,,$ UNIT 1 IN SERVICE
into:
$... (1 Reply)
Discussion started by: apalex
1 Replies