10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to remove a specific number of lines, above and below a specific line of text, highlighted in red:
<STMTTRN>
<TRNTYPE>CREDIT
<DTPOSTED>20151205000001
<TRNAMT>10
<FITID>667800001
<CHECKNUM>667800001
<MEMO>BALANCE
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20151207000001... (8 Replies)
Discussion started by: bomsom
8 Replies
2. UNIX for Advanced & Expert Users
Hi ,
i have a file with data as below.This is same file. But actual file contains to many rows.
i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ?
Field 004... (7 Replies)
Discussion started by: vadlamudy
7 Replies
3. Shell Programming and Scripting
Dear Specialists,
I have following data
1 1 2
2 2 3
3 3 6
4 3 4
5 4 9
6 5 11
7 6 7
and I would like to obtain data like below
1 1 2
2 2 3
4 3 4
7 6 7 (2 Replies)
Discussion started by: Ryan Kim
2 Replies
4. Shell Programming and Scripting
Hi,
I have a text file with some lines like this:
/MEDIA/DISK1/23568742.MOV
/MEDIA/DISK1/87456321.AVI
/MEDIA/DISK2/PART1/45753131.AVI
/IMPORT/44452.WAV
...
I want to remove the last 12 characters in each line that it ends "AVI". Should look like this:
/MEDIA/DISK1/23568742.MOV... (12 Replies)
Discussion started by: inaki
12 Replies
5. Shell Programming and Scripting
Hi, I'm totally new to awk, so thanks in advance for your help.
I want to make a csv file out of a text file I've exported from a database I want to do two things:
1. Change pipes ("|") to commas (",") to make a text file into CSV
2. Remove the second line of the file, which is useless junk. ... (3 Replies)
Discussion started by: pip56789
3 Replies
6. Shell Programming and Scripting
Hi All,
I have came across an issue where I will grep for a primary key and then I have to delete that particular line from the feed file and then save it.
The feed file is a TAB delimited one.
For example:
grep 539439AE9 file1
100.00000 20090119 20090119 20090521 ... (4 Replies)
Discussion started by: filter
4 Replies
7. Shell Programming and Scripting
Hello.
My file is like this:
a
b
c
d
e
f
g
h
i
I want to delete all lines after the 3rd line, means after the "c". Is there any way to do this? The lines differ between them and the lines I want to delete does not have a specific word, or the lines I want to keep (a,b,c) does not have a... (4 Replies)
Discussion started by: hakermania
4 Replies
8. Shell Programming and Scripting
Hi,
I'm genrating a file from sql and the file looks like :
$value1=A
$value2=B
$value3=
$value4=
$value5=C
I want to delete those two lines which has Null after '='. Could you please guide me how to do it either using sed or awk ? (9 Replies)
Discussion started by: santanu83_cse
9 Replies
9. Shell Programming and Scripting
Hi guys ,
I m writing a script to delete a line at particular location.
But i m unable to use variable for specifying line number.
for example.
sed -n '7!p' filename
works fine and deletes 7th line from my file
but
sed -n '$variable!p' filename
gives following error.
sed: -e... (12 Replies)
Discussion started by: pinga123
12 Replies
10. UNIX for Dummies Questions & Answers
I am trying to delete the line with pattern and the next line. Found the below command in forum which also deleted the previous line. how should i modify that to make sure that only the line with pattern and the next line are deleted but not the previous line?
awk '/key... (1 Reply)
Discussion started by: rdhanek
1 Replies