10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All
I'm trying to insert a new line at the before each comment line in a file.
Comment lines start with '#-----'
there are other comments with in lines but I don't want a new line there.
Example file:
blah
blah #do not insert here
#this is a comment
blah #some more
#another comment... (10 Replies)
Discussion started by: Mudshark
10 Replies
2. Shell Programming and Scripting
Hi All,
I have file like this:
file1:
3778 10474 24
3778 10475 24
3778 10476 25
3778 10495 26
3794 10001 33
3794 10002 33
3794 10004 33
3794 10007 34
3794 10008 34
3794 10011 34
3794 10012 34
3794 10013 34
3794 10017 34
3810 10282 27 (6 Replies)
Discussion started by: attila
6 Replies
3. Shell Programming and Scripting
I have created with the DOS-command dir a list of a directory.
Directory of C:\Users\User\Documents
09.06.2011 20:50 48.322 file1.txt
02.11.2010 23:00 9.216 file2.txt
15.12.2010 21:06 26.793 file2.txt
Now i would like to add the directory ahead of the filename. Therefore a... (6 Replies)
Discussion started by: sdf
6 Replies
4. Shell Programming and Scripting
Hi all,
I've googling around forum regarding my prob, the nearest would same as thread tittled Insert blank line if grep not found, but she/he did not mention the solution, so I would like to request your help
I've this task, to search in file2 based on pattern in file1 and output it to... (4 Replies)
Discussion started by: masterpiece
4 Replies
5. Shell Programming and Scripting
Hi,
I just wanted to know if you have any idea or script to insert a text at everyend of the line, the text will vary. for example
sample:
this is line1 ok
this is line2 ok
this is line3 ok
output:
this is line1 ok /home/line1.txt
this is line2 ok /home/line2.txt
this is line3 ok... (6 Replies)
Discussion started by: invinzin21
6 Replies
6. UNIX for Dummies Questions & Answers
file1 contains:
this is a test
this is a test and only a test
this is another test
this is another test and only another only
i'd like my file to look like this:
this is a test.
this is a test and only a test.
this is another test.
this is another test and only another only. (6 Replies)
Discussion started by: tjmannonline
6 Replies
7. Shell Programming and Scripting
Hi, excuse me for my poor english.
My problem is that:
I have a File
i want to add to each line of that file two strings: one at the beginning of the line, one at the ending.
string1="abcd"
string2="efgh"
i want $string1 content $string2 for each line.
Is that possible? (3 Replies)
Discussion started by: Linux-fueled
3 Replies
8. Shell Programming and Scripting
Hey gang,
I have:
XXZZXXZZXX 123 asdaffggh dfghyrgr ertyhdhh XXZZXXZZXX 234 sdg XXZZXXZZXX 456 gfg fggfd
That is all on one line. Very simply put I want to do is something like:
sed s'/XXZZXXZZXX /\n/g'
or
tr 'XXZZXXZZXX ' '/n'
I have tried various things but can never get the desired... (6 Replies)
Discussion started by: crowman
6 Replies
9. Shell Programming and Scripting
Hi,
This thread is an extension of the post I posted in another folder for Unix Dummies.
I am actually trying to read all the files in a folder, let say folder A.
There are alot of .txt files in this folder where I have sed them and translate to numeric elements.
For example:-
I have... (5 Replies)
Discussion started by: ahjiefreak
5 Replies
10. Shell Programming and Scripting
Hello everyone... please help if you can -- I'm stumped. Making this work will save me hours of manual labor:
I need to search file2 for pattern in file1. If pattern found append file2 line to file3. If pattern not found append a blank line to file3.
file1 contents example:
123
456
789... (6 Replies)
Discussion started by: michieka
6 Replies